- Home /
Facebook Unity SDK - iOS Login not persisting
I have the most recent Facebook SDK from the Unity app store (the beta version) and I am currently setting it up to do things such as invite players and send OpenGraph objects etc. This is all seemingly working fine on my Android device, logging in, getting a list of friends to select from etc. however when I am trying to use the exact same code on iOS, I am running in to problems. Instead of opening up the Facebook app to check for a currently logged in user, the web-app version of Facebook is loading over my app, asking the player to log in (even after they have logged in this way previously).
The code I am using is basically the code shown throughout the following page: Facebook Unity SDK Tutorials
Is there something different that needs doing in iOS that isn't required for Android?
Thanks, Sosp
Answer by Sospitas · Oct 23, 2014 at 12:13 PM
Okay, so I figured this one out myself after digging around for a while. The current latest version of the Facebook Unity SDK does not take into account multiple App ID's in the Facebook Settings menu. This meant that when building and selecting the 'append' option (to save all of the other settings in XCode), the App ID was not being reset to the newly selected version that I wanted. This led to Facebook being unable to find the App based on the ID, and therefore not using the Facebook App or Safari login flows and instead just using the Web version (which seemingly did nothing).
To fix this: - Build your project - Open XCode and in the file directory open Info.plist - Set FacebookAppID value to your target App ID (In Facebook->Edit Settings menu) - Open URL types -> Item0 -> URL Schemes - Set URL Schemes/Item 0 to "fb + your target App ID (In Facebook->Edit Settings menu)
This should now cause your app to use the Facebook App if it is installed