Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple apps are using the same FaceBook Single Sign-On account, how to choose which one opens the login screen?

I have an issue with the Facebook iOS SDK. Here is what happens:

  • I have one Facebook app
  • I have 2 versions of my iPhone app (one free, one paid), so 2 different bundle identifiers (com.company.iphone-free and com.company.iphone-paid).
  • both apps uses the same Facebook ID app for single sign-on.
  • all is setup like described in the facebook documentation, delegates url schemes ...

The issue is, if from the free app I'm trying to use Facebook, it quits the app, goes to the Facebook app and back to my app, but to the paid app, it launches the paid one and not the free one. Is there a way to avoid that?

If I have just one of the version (paid or free) installed on the device, it works well.

I know I could create a specific Facebook app for each version of the iphone app, but I definitely don't want that.

like image 976
Grégoire Aubin Avatar asked Nov 02 '11 22:11

Grégoire Aubin


People also ask

How can I see what Apps I use Facebook to login for?

Tap in the top right of Facebook. Scroll down and tap Settings. Tap Apps and Websites. Tap Logged in with Facebook.


2 Answers

There's some specific changes that need to be made to support multiple IOS apps using the same Facebook app ID with the Single Sign-On Authentication

See https://developers.facebook.com/docs/howtos/share-appid-across-multiple-apps-ios-sdk/ for more information.

The most important things to check are:

  • Do you have the URL Scheme suffixes defined? (ie fb1234free:// instead of fb1234://)
  • Do you have those suffixes defined in the developer app in the order you want Facebook to use them?
like image 167
Igy Avatar answered Oct 20 '22 19:10

Igy


All i did to fix is:

1) Add FacebookUrlSchemeSuffix property with different values for different apps (e.g. myproapp and myfreeapp) (in ****-Info.plist, ****-Info Demo.plist)

2) Edit URL Types -> Item 0 -> URL Schemes -> Item 0 to looks like fb1234567890myproapp and fb1234567890myfreeapp

like image 1
Anton Plebanovich Avatar answered Oct 20 '22 19:10

Anton Plebanovich