Since the update to Facebook 4.x, the following no longer works:
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
{
return [FBAppCall handleOpenURL:url sourceApplication:@"yyyyxxxxyyyxxxx" withSession:[PFFacebookUtils session]];
}
as both application: handleOpenURL
has been deprecated, and FBAppCall has been removed to be replaced with BFURL.
I've tried reading the Bolts 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 the BFURL. Previously, this method just contained:
return [[FBSDKApplicationDelegate sharedInstance] application:application
openURL:url
sourceApplication:sourceApplication
annotation:annotation];
}
but now every time I try to login to FB (w/o the FB app installed), it exits to Safari, approves the app, returns to my app, but reboots it, and fails to log in. After about 4 successive tries, it sometimes logs in. I presume this is because I'm not correctly handling the return to the app, but not sure what to add.
Replace the old return with this:
return [[FBSDKApplicationDelegate sharedInstance] application:app openURL:url sourceApplication:options[UIApplicationLaunchOptionsSourceApplicationKey] annotation:options[UIApplicationLaunchOptionsAnnotationKey]];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With