Facebook SDK for Android - set Application ID programmatically

后端 未结 5 1187
逝去的感伤
逝去的感伤 2020-12-29 10:56

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.

Ima

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-29 11:29

    Yes, you can set it programmatically. Use the Sessions$Builder class which allows you to build a session without needing to use one of the private constructors.

    Session session = new Session.Builder(context).setApplicationId(applicationId).build();
    

提交回复
热议问题