Search code examples
androidfacebookfacebook-android-sdk

Set Facebook Application Id programmatically in 4.x


Back in SDK 3.x, I used as stated in this question:

session = newSession.Builder(Activity).setApplicationId(String).build();

But since there is no Session class in 4.x, how can I set the application Id programmatically? I know it should be in the resources, but I am actually building a library and expecting to receive it from a client application so setting it in JAVA is my only option.


Solution

  • FacebookSdk.setApplicationId(yourId)

    More detail here https://developers.facebook.com/docs/reference/android/current/class/FacebookSdk/