Facebook Single Sign-On Opens Wrong Application

Hi guys, I have a problem with the iOS SDK. Here's what happens:

  • I have a Facebook app.
  • I have 2 versions of my iPhone application (one free, one paid), so two different package identifiers (com.company.iphone-free and com.company.iphone-paid).
  • Both applications use the same Facebook login application for single sign-on.
  • everything is configured as described in the documentation on facebook, delegates url schemes ...

The problem is that if I try to use Facebook from a free application, it leaves the application, goes to the Facebook application and back to my application, but it launches a paid rather than free one in a paid application. Is there any way to avoid this?

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

I know that I can create a specific Facebook application for each version of the iphone application, but I definitely do not want this.

+6
source share
2 answers

There are some specific changes that need to be made to support multiple iOS applications using the same Facebook application identifier with Single Sign-On authentication.

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

The most important things to check:

  • Are URL scheme suffixes defined? (i.e. fb1234free: // instead of fb1234: //)
  • Do you have these suffixes defined in the developer app in the order you want to use Facebook?
+9
source

All I did to fix it:

1) Add the FacebookUrlSchemeSuffix property with different values ​​for different applications (for example, myproapp and myfreeapp) (in **** - Info.plist, **** - Info Demo.plist)

2) Change URL Types β†’ Item 0 β†’ URL Schemas β†’ Item 0 to look like fb1234567890myproapp and fb1234567890myfreeapp

0
source

Source: https://habr.com/ru/post/900649/


All Articles