Facebook Login doesn't return to app with Xcode 7 iOS 9

I implemented this method to login to Facebook in App Delegate using Xcode 7, and it works fine:

- (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 send my application to the App Store, this method does not exist and it gives me errors.

If I commented on the above method and left 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 log in, he will not return to the application.

Is there an easy solution for this? Thanks!

By the way, I carefully followed all the steps in: https://developers.facebook.com/docs/ios/getting-started

+5
source share
1 answer

There seems to be no way to get the previous behavior using the new FB SDK in iOS9. You can use the old SDK for this. Here is the facebook answer to this question:

enter image description here

+11
source

All Articles