Facebook SDK Login crashes on iOS 10


I am currently working on implementing facebook login, and I am using Unity 5.5.0f3 and Facebook SDK 7.9.0.

I can login to facebook and retrieve an AccessToken on Android without any problems. But when I am trying to login to facebook on iOS10 the application usually crashes whenever I confirm the login on the facebook site.

I managed to get it working on 1 iOS10 device, when the user could choose to login manually using his email and password, and now he can pretty much use the login without his application crashes.

In the log I get the output:

'fb_mobile_login_native_app_switch_dialog_result'. Must be between 1 and 40 characters, and must be contain only alphanumerics, _, - or spaces, starting with alphanumeric or _.```

It seems to me, that the Facebook SDK needs to be updated according to the new changes in iOS10. Does anyone have a solution to this problem? I’ve checked various posts on similar problems, but without any luck for a solution.

Related questions and discussions:

I thought someone must got this before today.
After running around Google.
Here is a solution for me

I’m not alone! Same here, but on iOS 9 + 10. Been trying to debug it for days.

Basically, a user clicks my MP button. In the background, it uses the PrompForLogin function. It goes to the Facebook website, asks to give the App approval and then if the user clicks “Okay”, it loads for about a second and then hard crashes.

According to the XCode debugger and my debug statements, it looks like it never makes it back to the app as the step immediately after granting FB authorization never runs.

I have to leads: One is a log error I’ve been seeing: "-canOpenURL: failed for URL: “fbauth2:/” - error: “(null)” , but, according to FB, this can be ignored if your Info.plist is properly configured (WHich it should be by the FB plugin)

The other is the XCode debugger keeps giving me a nil error. I thought it was unrelated until I saw this post on StackOverflow: Can't login using Facebook Login on iOS 10 - Stack Overflow

It seems like maybe the returned token has a nil value and needs to be polled for a few frames? Dunno. Let us know what you find out!