Using undeclare identifier 'FBRequestConnection'
I am trying to implement Facebook functionality, but I have an error in the following line of code:
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/photos",[fbidarray objectAtIndex:j]] parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error1)
Mistake:
use of undeclare identifier 'FBRequestConnection'
I imported the following frameworks:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
Does any of you know why the error is?
I will be very grateful for your help.
source to share
Use FBSDKGraphRequest
instead.
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc] initWithGraphPath:@"me"
parameters:nil];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection, id result, NSError *error) {
// TODO: handle results or error of request.
}];
This is from the docs
Requests - FBSDKGraphRequest and FBSDKGraphRequestConnection reside in FBSDKCoreKit and provide helpers access to the Graph API. They are very similar to FBRequest and FBRequestConnection in v3.x. By default, they use [FBSDKAccessToken currentAccessToken] to issue requests, so you usually issue requests after logging in.
Also I searched FBRequestConnection
facebook sdk but couldn't find it.
source to share