我已经将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)