FBAppCall removed update 4.x from Facebook - return to the application after logging in to Facebook

Since upgrading to Facebook 4.x, it no longer works:

- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url { return [FBAppCall handleOpenURL:url sourceApplication:@"yyyyxxxxyyyxxxx" withSession:[PFFacebookUtils session]]; } 

since both application: handleOpenURL deprecated and the FBAppCall has been removed to replace BFURL.

I tried reading the Bolt Documentation , which suggests the following:

 - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { BFURL *parsedUrl = [BFURL URLWithInboundURL:url sourceApplication:sourceApplication]; //do something with parsedUrl if neccessary 

... but then I'm not sure what to do with BFURL. Previously, this method simply contained:

 return [[FBSDKApplicationDelegate sharedInstance] application:application openURL:url sourceApplication:sourceApplication annotation:annotation]; } 

but now every time I try to enter FB (without the FB application installed), it exits in Safari, approves the application, returns to my application, but restarts it and cannot log in. After about 4 consecutive attempts, he sometimes enters the system. I suppose this is due to the fact that I am not correctly processing the return to the application, but I'm not sure what to add.

+5
source share
2 answers

Replace the old return as follows:

 return [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:options[UIApplicationLaunchOptionsSourceApplicationKey] annotation:options[UIApplicationLaunchOptionsAnnotationKey]]; 
+4
source

If you use FBSDKLoginManager, you can also specify a handler for the loginInWith * Permissions methods. A handler is a callback when your application starts up again (specify what logic you used to call the FBAppCall to enter that handler).

Then connect the application delegate class to FBSDKApplicationDelegate, as described in the Getting Started Guide . This will tell the SDK to call your handler.

Read more about login on iOS here .

0
source

All Articles