问题描述
我已经使用 Xcode 7 在 App Delegate 中为 Facebook 登录实现了这种方法,并且效果很好:
- (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options {返回 [[FBSDKApplicationDelegate sharedInstance] 应用程序:应用程序打开网址:网址sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]注释:选项[UIApplicationOpenURLOptionsAnnotationKey]];}
但是,由于我需要使用 Xcode 6 将我的应用程序提交到 App Store,因此此方法不存在并且它给我错误.
如果我评论上面的方法,只留下以下内容:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {返回 [[FBSDKApplicationDelegate sharedInstance] 应用程序:应用程序打开网址:网址源应用:源应用注释:注释];}
它不会工作,即当用户尝试登录时,它不会返回到应用程序.
有没有简单的解决方法?谢谢!
顺便说一句,我已经认真遵循以下所有步骤:
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]];
}
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!
BTW, I have followed diligently all steps in : https://developers.facebook.com/docs/ios/getting-started
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 登录不会返回到应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!