我已经更新了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"
我正在使用以下方法来执行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];
}
我在plist文件下有以下设置
<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应用程序。
发布于 2015-09-16 02:25:22
这是设计好的。Facebook与iOS9之间仍然存在一些问题。
看脸书团队回复:https://developers.facebook.com/bugs/786729821439894/?search_id,谢谢
发布于 2015-10-12 18:32:28
最后,我将我的Podfile更改为以前的FB版本:
发自:
pod 'FBSDKCoreKit' pod 'FBSDKLoginKit' pod 'FBSDKShareKit'
至:
pod 'FBSDKCoreKit','~>4.5.1'
pod 'FBSDKLoginKit','~>4.5.1'
pod 'FBSDKShareKit','~>4.5.1'
在我看来,Facebook应该检查用户的最后一次登录,并在此基础上触发正确的登录流程。(并将小开发人员排除在"web vs原生战争“之外)。
发布于 2015-09-15 00:22:54
@dan是对的。为了给用户在iOS 9上提供最好的体验,新的SDK会自动确定最佳登录流程。如果你运行的是iOS 8或更早的版本,应用程序开关仍然是首选。
https://stackoverflow.com/questions/32566734
复制相似问题