Two iOS apps using the same Facebook app ID - is it possible?

前端 未结 2 962
时光说笑
时光说笑 2020-12-02 17:36

I\'m using the latest facebook iOS SDK (supporting SSO) to connect my iPhone app with facebook. So far so good..

Since my current app is free with ads, I would like

相关标签:
2条回答
  • 2020-12-02 18:26

    I had to use FBLoginView in my app, and none of this solutions worked. The only missing thing was that i needed to add a new entry in the plist file: FacebookUrlSchemeSuffix (documented here, in the Step 2).

    Suppose that your App ID is 123456, what i had to do was:

    1) In your facebook app, add a URL Scheme Suffix in the iOS section:

    enter image description here

    2) In both of your applications, go to the app's .plist, and add the following entry:

    enter image description here

    Note that the Value must be one of the URL Scheme Suffixes added.

    3) Also change your URL Scheme for Facebook in the .plist file to fb. For example, fb123456client

    enter image description here

    0 讨论(0)
  • 2020-12-02 18:30

    In the latest Facebook iOS SDK on Github there's a method called authorize:delegate:localAppId: initWithAppId:urlSchemeSuffix:andDelegate:. You can use the localAppId urlSchemeSuffix parameter to distinguish multiple iOS Apps that use the same Facebook application id. The method documentation says:

    urlSchemeSuffix is a string of lowercase letters that is appended to the base URL scheme used for SSO. For example, if your facebook ID is "350685531728" and you set urlSchemeSuffix to "abcd", the Facebook app will expect your application to bind to the following URL scheme: "fb350685531728abcd". This is useful if your have multiple iOS applications that share a single Facebook application id (for example, if you have a free and a paid version on the same app) and you want to use SSO with both apps. Giving both apps different urlSchemeSuffix values will allow the Facebook app to disambiguate their URL schemes and always redirect the user back to the correct app, even if both the free and the app is installed on the device.

    urlSchemeSuffix is supported on version 3.4.1 and above of the Facebook app. If the user has an older version of the Facebook app installed and your app uses urlSchemeSuffix parameter, the SDK will proceed as if the Facebook app isn't installed on the device and redirect the user to Safari.

    0 讨论(0)
提交回复
热议问题