Frage

I've implemented facebook sdk into my project and everything is setup exactly as shown in guide https://developers.facebook.com/docs/facebook-login/ios/v2.0, including info.plist file.

FacebookAppID, FacebookDisplayName and URL types are set (see image)

Info.plist setup

Everything is working when I use facebook app login, or browser login, but when I've added account into devide, so iOS native login dialog should be present, nothing happend, log only displays User cancelled every time I press Facebook login button.

I've done several projects before with facebook login implementation and I've not experienced this error. I think I'm missing something but somehow I can't figure. The appId and item 0 with prefix have the same numbers and display name is copied exactly from FB developer.

The strange issue I've noticed here is that when I first install app on device with FB account setup in settings, I can click it once...nothing happend and after second click the application is automatically disabled in Settings > Facebook.

UPDATE: I was able to login with native login dialog with older version of Facebook SDK (I've just replaced latest SDK with older one and now it works...don't forget to change permissions because latest SDK uses permissions public_profile instead of basic_profile used in older versions of SDK) why native login is not working with latest FB SDK is still a mistery :)

War es hilfreich?

Lösung

The answer to

'why native login is not working with latest FB SDK is still a mystery'?

is here. See the upgrade guide form 3.13 > 3.14. The default login behavior has changed from FBSessionLoginBehaviorUseSystemAccountIfPresent to FBSessionLoginBehaviorWithFallbackToWebView

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top