Facebook login after set Screen.orientation

Hi,

For our cross platform game we are using the Facebook SDK.

The mobile version of the game runs in portrait, and the tablet version of the game in landscape.

We will detect the device runtime and after that we’ll setup the right orientation (portrait or landscape) for the player.

But after this, we will call this line:
Screen.orientation = ScreenOrientation.Portrait;

or:
Screen.orientation = ScreenOrientation.Landscape;

But Facebook login is not working anymore after this. It is related to showing UIWebView.

Is there anyone over here that has the same issue, and solved it already somehow? Or anyone knows how to deal with it?

P.S. We tried to setup only landscape for tablet and only portrait in XCode, but it seems Unity is ignoring this settings and will let rotate the app anyway.

Having the same issue, can’t figure out why.

Edit* I posted a bug report in Unity but it would seem that this doesn’t solely affect FB login but really any iOS Native Popup stuff. We are signing up our users with some Apple services that I can’t disclose as well as a plugin that opens up the iOS Native Window for another thing and those will not work either.

So happy I found this post! I never thought to think the broken facebook login was somehow linked to Screen orientation. I gave the bug report a vote. Here is the link for others: Unity Issue Tracker - [iOS] Cannot open URL when launching FBlogin through Unity Facebook SDK in portrait only autorotate state