Facebook Login does not return to App with Xcode 7 iOS 9

左心房为你撑大大i 提交于 2020-01-01 10:57:10

问题


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


回答1:


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:



来源:https://stackoverflow.com/questions/32567179/facebook-login-does-not-return-to-app-with-xcode-7-ios-9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!