首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >在iOS 9中,本地Facebook应用程序不能以Facebook登录打开

在iOS 9中,本地Facebook应用程序不能以Facebook登录打开
EN

Stack Overflow用户
提问于 2015-09-14 21:59:03
回答 9查看 47.3K关注 0票数 52

我已经更新了iPhone 6 plus到iOS 9测试版,并试图执行Facebook登录,但每次它都呈现带有Facebook登录表单的UIWebView。

我有Facebook sdk

代码语言:javascript
复制
FB_IOS_SDK_VERSION_STRING @"3.24.0"
FB_IOS_SDK_TARGET_PLATFORM_VERSION @"v2.2"

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

代码语言:javascript
复制
    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];
     }

我在plist文件下有以下设置

代码语言:javascript
复制
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fbapi20130214</string>
        <string>fbapi20130410</string>
        <string>fbapi20130702</string>
        <string>fbapi20131010</string>
        <string>fbapi20131219</string>
        <string>fbapi20140410</string>
        <string>fbapi20140116</string>
        <string>fbapi20150313</string>
        <string>fbapi20150629</string>
        <string>fb-messenger-api20140430</string>
        <string>fbauth</string>
        <string>fbauth2</string>
   <array>

请让我知道我在这里错过了什么。首先,它正在检查iPhone device Setting-> Facebook credentials,但永远不会打开Facebook应用程序进行登录。它似乎无法识别安装在设备上的Facebook应用程序。

EN

回答 9

Stack Overflow用户

发布于 2015-09-16 02:25:22

这是设计好的。Facebook与iOS9之间仍然存在一些问题。

看脸书团队回复:https://developers.facebook.com/bugs/786729821439894/?search_id,谢谢

票数 33
EN

Stack Overflow用户

发布于 2015-10-12 18:32:28

最后,我将我的Podfile更改为以前的FB版本:

发自:

pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit'

至:

代码语言:javascript
复制
pod 'FBSDKCoreKit','~>4.5.1'
pod 'FBSDKLoginKit','~>4.5.1'
pod 'FBSDKShareKit','~>4.5.1'

在我看来,Facebook应该检查用户的最后一次登录,并在此基础上触发正确的登录流程。(并将小开发人员排除在"web vs原生战争“之外)。

票数 11
EN

Stack Overflow用户

发布于 2015-09-15 00:22:54

@dan是对的。为了给用户在iOS 9上提供最好的体验,新的SDK会自动确定最佳登录流程。如果你运行的是iOS 8或更早的版本,应用程序开关仍然是首选。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/32566734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档