Facebook SDK handleOpenURL fails
I am using Facebook SDK for iOS 3.7.1 to log in to Facebook. When I
attempt to log in using the simulator, I am taken to Mobile Safari, where
I authorize the login, and it then returns to my app.
When I call [FBSession.activeSession handleOpenURL:url], I am getting a
return value of NO, and it does not log in successfully, even though the
URL appears to be valid. Here is an example of the URL that I am getting:
fb[my_app_id]://authorize/#access_token=[long_string_of_numbers_and_letters]&expires_in=5180182&state=%7B%22is_open_session%22%3Atrue%2C%22is_active_session%22%3Atrue%2C%22com.facebook.sdk_client_state%22%3Atrue%2C%223_method%22%3A%22browser_auth%22%2C%220_auth_logger_id%22%3A%225F10EA11-220E-4650-BA0B-76D8B424B3CB%22%7D&e2e=%7B%22init%22%3A1378709519868%2C%22submit_0%22%3A1378709527888%7D
My code worked fine with a prior version of the Facebook SDK.
Does anybody have any idea why handleOpenURL: would return NO on what
appears to be a valid URL?
Update: I have this problem if I use the code:
self.session = [[[FBSession alloc] init] autorelease];
[FBSession setActiveSession:self.session];
[FBSession
openActiveSessionWithReadPermissions:@[@"basic_info",@"email",@"user_photos"]
allowLoginUI:YES
completionHandler:^(FBSession *session,
FBSessionState status, NSError *error) {
However, if I use my old code it works fine:
self.session = [[[FBSession alloc] init] autorelease];
[FBSession setActiveSession:self.session];
[self.session openWithCompletionHandler:^(FBSession *session,
FBSessionState status, NSError *error) {
No comments:
Post a Comment