The documentation for the new Facebook SDK 3.0 tells us this:
“In some cases, the iOS device won’t have an access token for a user who has already connected an app to their Facebook account. This can happen when a user used an app’s website or used the app on another mobile device. To use the iOS 6 native Auth Dialog, apps need to ‘import’ the user’s credentials into the device and need to show the iOS 6 native Auth Dialog.”
(see http://developers.facebook.com/docs/howtos/ios-6/, tip 2)
I’d like to know how to import this data, I can’t find a code example.
Thanks,
Tim
P.S. For information (and testing purposes) it’s easy to reproduce the above situation in an app:
- In the settings app, delete the Facebook account
- In the app under development connect to Facebook via SSO, (it should fall back to this given that there’s no Facebook account registered under iOS6
- Set up the Facebook account again in the settings app
- Once again, try signing in via the app under developement. This time it will still access Facebook via SSO since the token was created using it.
As MrNickBarker suggested the solution is to log the user out of SSO. However, I only wanted to do this if I was absolutely sure that in doing so they user would be logged back in via the iOS 6 authentication system.
My problem was that I didn’t know of a way of ensuring that the user was logged into Facebook via the Settings app, and I didn’t want to log the user out of Facebook only to have them send back to the Facebook app for an SSO login each and every time.
None of the ACAccountStore methods will tell you if the user has entered their Facebook details into the Settings app, hwoever I finally discovered [SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook] which does exactly this.
Here then is the solution: