简体   繁体   中英

iOS Facebook Authorize failing if Facebook app is installed

Facebook SSO authentication is working just fine in my iOS app when using Safari, but if I have the Facebook app installed SSO redirects over to it instead and the authorization hangs. It's not failing like many other people on SO are talking about, I'm getting an empty dialog box that just says "Loading..." It hangs forever and eventually crashes.

I can force my app to always use Safari authentication, but I'd like to know if there is a way to get the FB app working before I resort to that.

I've got the same behavior and the appDelegate method was implemented.

By looking at the URL received by this method I've realized my bundle ID was different on the app config at the Facebook page: "fb41810xxxxxx://authorize#error_description=Invalid%2BIOS%2Bbundle%2BID&error=unknown%5Ferror"

I've corrected the setting and everything worked fine.

Ensure your appdelegate is implementing the method application:openURL, like:

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
  sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
  return [[[FacebookController sharedInstance] facebook ]handleOpenURL:url]; 
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM