使用Xcode 7 iOS 9的Facebook登录不会返回到App [英] Facebook Login does not return to App with Xcode 7 iOS 9
问题描述
我已经使用Xcode 7在App Delegate中实现了用于Facebook登录的此方法,并且效果很好:
I have implemented this method for Facebook Login in the App Delegate using Xcode 7 and it works perfectly:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary<NSString*, id> *)options {
return [[FBSDKApplicationDelegate sharedInstance] application:app
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}
但是,由于我需要使用Xcode 6将我的应用提交到App Store,因此该方法不存在,并且会给我带来错误.
However, since I need to use Xcode 6 to submit my app to the App Store, this method does not exists and it give me errors.
如果我评论上述方法,仅保留以下内容:
If I comment the above method, and leave only the following:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation
];
}
它不起作用,也就是说,当用户尝试登录时,它不会返回到应用程序.
it will not work, that is, when the user tries to Login, it does not return to the Application.
对此有一个简单的解决方法吗?谢谢!
Is there an easy fix for this? Thanks!
顺便说一句,我认真地遵循了以下所有步骤: https://developers.facebook. com/docs/ios/getting-started
BTW, I have followed diligently all steps in : https://developers.facebook.com/docs/ios/getting-started
推荐答案
似乎没有办法使用iOS9中的最新FB SDK来获得以前的行为.您可以使用旧的SDK来执行此操作.这是Facebook对这个问题的回应:
Seems there's no way to get the previous behavior using newests FB SDKs in iOS9. You can use a old SDK to do that. Here's a response from the facebook to that question:
这篇关于使用Xcode 7 iOS 9的Facebook登录不会返回到App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!