- (void)authorize:(NSArray *)permissions {
self.permissions = permissions;
[self authorizeWithFBAppAuth:NO safariAuth:NO];
}
Ok, the above code is what I am trying to implement. But this code is giving me two errors. The first one is property permission not found in Facebook and second one is instance authorize authorizeWithFBAppAuth: not found.This is share kit 2.0 so maybe this will not work on it, but I need to stop the Facebook app popping up. P.S. I am a Sharekit noob.
- (void)authorize:(NSArray *)permissions {
// if we already have a session, git rid of it
[self.session close];
self.session = nil;
[self.tokenCaching clearToken];
self.session = [[[FBSession alloc] initWithAppID:_appId
permissions:permissions
urlSchemeSuffix:_urlSchemeSuffix
tokenCacheStrategy:self.tokenCaching]
autorelease];
[self.session openWithCompletionHandler:^(FBSession *session, FBSessionState status, NSError *error) {
switch (status) {
case FBSessionStateOpen:
// call the legacy session delegate
[self fbDialogLogin:session.accessToken expirationDate:session.expirationDate];
break;
case FBSessionStateClosedLoginFailed:
{ // prefer to keep decls near to their use
// unpack the error code and reason in order to compute cancel bool
NSString *errorCode = [[error userInfo] objectForKey:FBErrorLoginFailedOriginalErrorCode];
NSString *errorReason = [[error userInfo] objectForKey:FBErrorLoginFailedReason];
BOOL userDidCancel = !errorCode && (!errorReason ||
[errorReason isEqualToString:FBErrorLoginFailedReasonInlineCancelledValue]);
// call the legacy session delegate
[self fbDialogNotLogin:userDidCancel];
}
break;
// presently extension, log-out and invalidation are being implemented in the Facebook class
default:
break; // so we do nothing in response to those state transitions
}
}];
}
This code above is the original that came with share kit 2.0, if there is a way to stop Facebook app popping up in the above code please let me know.