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.
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.
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.
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?
Hello all i know above answer is right for older sdk version
, but in facebook sdk 4
there is no Session
class
You can simply do it by using this single line code:
FacebookSdk.setApplicationId(APP_ID);
Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With