Facebook的SDK为Android - 一套应用程序编程ID应用程序、SDK、Facebook、ID

2023-09-06 02:15:45 作者:丑小鸭变成了烤鸭

我有一个原生的Andr​​oid应用程序,需要连接到一个不同的Facebook应用程序(不同的应用程序ID)的基础上,可以在运行时改变一个应用程序的设置。

I have a native Android app that needs to connect to a different Facebook app (different Application ID) based on an app setting that can be changed at runtime.

想象一下,应用程序可以设置为指向DEV,TEST或PROD。当指着dev目录下FB应用程序ID应该是1。当指出,试验中的FB应用程序ID应该是2。等等。

Imagine the app can be set to point to DEV, TEST, or PROD. When pointed to DEV the FB Application ID should be "1". When pointed to TEST the FB Application ID should be "2". etc.

现在的问题是,从Facebook的SDK中的UiLifecycleHelper过程中的onCreate阶段自动读取com.facebook.sdk.ApplicationId在AndroidManifest.xml中。似乎没有要一种方法来设置这种编程

The problem is the UiLifecycleHelper from the Facebook SDK automatically reads the "com.facebook.sdk.ApplicationId" from the AndroidManifest.xml during the onCreate phase. There doesn't appear to be a way to set this programmatically.

是否有可能使用UiLifecycleHelper并指向不同的应用程序ID在运行时或我必须退回到手动管理会话?

Is it possible to use UiLifecycleHelper and point to a different application ID at runtime or do I have to fall back to manually managing the Session?

推荐答案

我决定叉GitHub上Facebook的Andr​​oid的SDK项目,并进行必要的修改。我已经提交了拉请求,我的变化,如果有人有兴趣,的https:// github上.COM / Facebook的/ Facebook的Andr​​oid的SDK /拉/ 294 。

I decided to fork the facebook-android-sdk project on GitHub and make the necessary changes. I have submitted a pull request with my changes if anyone is interested, https://github.com/facebook/facebook-android-sdk/pull/294.