How to add metadata dynamically (not in the manifest, but inside the code)?

I want to set application metadata using code. Is this possible in Android? Trying to set the Facebook app id to code not inside the manifest.

meta-data android:name="com.facebook.sdk.ApplicationId"android:value="@string/applicationId" 

Please help me.

+2
source share
3 answers

This link shows how to add facebook app id: ADD DYNAMIC Facebook APP ID

+2
source

I want to set application metadata using code. Is this possible in android?

No, It is Immpossible. The manifest is parsed at compile time → you cannot add metadata at runtime.

+6
source

Hello everyone that I know above is suitable for the old version of sdk, but in

 facebook sdk 4+ 

no session class

You can simply do this using this code:

 FacebookSdk.setApplicationId(APP_ID); 

Thanks!

0
source

Source: https://habr.com/ru/post/982762/


All Articles