IOS 9中的Facebook登录SDK [英] Facebook Login SDK in IOS 9

查看:158
本文介绍了IOS 9中的Facebook登录SDK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用facebook登录SDK。它在IOS 7,8和9中完美运行。但是如果手机有facebook应用程序登录验证是在iOS 7和8中打开应用程序。但IOS 9没有打开Facebook应用程序。它打开浏览器(网页)并进行验证。是什么原因?有人有什么想法吗?

I am using the facebook login SDK. It is working perfectly in IOS 7, 8 and 9. But if phone have the facebook app login verification is open the app in iOS 7 AND 8. BUT IOS 9 not open the facebook app. It is open the browser (Web page) and doing the verification. What is the reason? Anybody have any idea?

已编辑

 FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init];
    [FBSDKProfile enableUpdatesOnAccessTokenChange:YES];

    [login logInWithReadPermissions:@[@"public_profile", @"email"]
                 fromViewController:self
                            handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) {

                                if (error) {
                                    NSLog(@"Process error");
                                } else if (result.isCancelled) {
                                    NSLog(@"Cancelled");
                                } else {
                                    NSLog(@"Logged in");

                                    [[NSNotificationCenter defaultCenter] postNotificationName:FBSDKProfileDidChangeNotification object:nil];
                                }
                            }];


推荐答案

这是设计使用并在iOS 9上使用SFSafariViewController 。如 v4.6更改日志中所述,

This is by design and is using SFSafariViewController on iOS 9. As noted in the v4.6 changelog,


SDK支持各种iOS 9功能,包括Bitcode。在
中,SDK对话框如Login,Like,Share Dialogs
自动确定基于设备的最佳UI,包括
SFSafariViewController而不是Safari

The SDK supports various iOS 9 features including Bitcode. In addition, the SDK dialogs such as Login, Like, Share Dialogs automatically determine the best UI based on the device, including SFSafariViewController instead of Safari

我们知道这可能会让人感到困惑,但我们肯定与开发人员有着相同的目标,以确保用户在iOS 9上获得最佳体验并获得良好的登录体验。在iOS 8上,登录仍然会更喜欢将应用程序切换到Facebook应用程序。

We know this may be confusing at first but we definitely have the same goal as our developers to make sure the users get the best experience on iOS 9 and have a good Login experience. On iOS 8, the login will still prefer an app switch to the Facebook app.

这篇关于IOS 9中的Facebook登录SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆