0
votes

I am using Xcode 7.2, testing on iOS 9.2 and using

pod "FBSDKCoreKit"; 
pod "FBSDKLoginKit"; 
pod "FBSDKShareKit"; 
pod "FBSDKMessengerShareKit"; 

After login its show error -canOpenURL: failed for URL: "fbauth2:/" - error: "(null)". In OS 7 and 8 it working fine. Please help someone.

 if ([FBSDKAccessToken currentAccessToken]) {
    // TODO:Token is already available.
    [[FBSDKLoginManager new] logOut];

}else{

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    login.loginBehavior=FBSDKLoginBehaviorBrowser;
[login
 logInWithReadPermissions: @[@"public_profile"]
 fromViewController:self
 handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {
     if (error) {
        NSLog(@"Process error");
     } else if (result.isCancelled) {
        NSLog(@"Cancelled");
     } else {
        NSLog(@"Logged in %@",result);
         [self getFacebookProfileInfo];
     }
 }];

}

After login its open this page only instead of close the screen. enter image description here

1
After adding this <string>fbauth2</string> under the <key>CFBundleURLSchemes</key> "fbauth2:/" - error: "(null)" is removed. And using this [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:UIApplicationOpenURLOptionsSourceApplicationKey annotation:UIApplicationOpenURLOptionsAnnotationKey] login view is closed but the result is not coming in block.CJ IOS Developer

1 Answers

0
votes

After adding this fbauth2 under the CFBundleURLSchemes "fbauth2:/" - error: "(null)" is removed. And using this [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:UIApplicationOpenURLOptionsSourceApplicationKey annotation:UIApplicationOpenURLOptionsAnnotationKey]

login.loginBehavior=FBSDKLoginBehaviorBrowser;

Facebook is working fine in IOS 9.2