相关疑难解决方法(0)

在iOS 9中,本地Facebook应用程序无法通过Facebook登录打开

我已经将iPhone 6 plus更新到iOS 9测试版,并试图执行Facebook登录,但每次使用Facebook登录表单呈现UIWebView.

我有Facebook sdk

FB_IOS_SDK_VERSION_STRING @"3.24.0"
FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2"
Run Code Online (Sandbox Code Playgroud)

我正在使用以下方法来执行Facebook登录

    NSArray *permissions = @[@"email",@"user_birthday",@"public_profile"];


     FBSessionStateHandler completionHandler = ^(FBSession *session, FBSessionState status, NSError *error) {
         [self sessionStateChanged:session state:status error:error];
     };

     if ([FBSession activeSession].state == FBSessionStateCreatedTokenLoaded) {
     // we have a cached token, so open the session
         [[FBSession activeSession]openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
                                 fromViewController:nil
                                  completionHandler:completionHandler];
     } else {

     [self clearAllUserInfo];
    [[NSURLCache sharedURLCache] removeAllCachedResponses];

     // create a new facebook session
     FBSession *fbSession = [[FBSession alloc] initWithPermissions:permissions];
     [FBSession setActiveSession:fbSession];
     [fbSession openWithBehavior:FBSessionLoginBehaviorUseSystemAccountIfPresent
              fromViewController:nil
               completionHandler:completionHandler];
     }
Run Code Online (Sandbox Code Playgroud)

我在plist文件下面进行了以下设置

    <key>LSApplicationQueriesSchemes</key>
    <array> …
Run Code Online (Sandbox Code Playgroud)

facebook objective-c ios facebook-login ios9

52
推荐指数
4
解决办法
4万
查看次数

标签 统计

facebook ×1

facebook-login ×1

ios ×1

ios9 ×1

objective-c ×1