You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
For the creation of some plugins, it is very useful to be able to read the Meta-Data information from the AndroidManifest file.
For instance, in the implementation of a plugin that integrates with Facebook SDK, it is very useful to validate the correct configuration of the Application:
finalStringFACEBOOK_APP_ID_NAME = "com.facebook.sdk.ApplicationId";
finalStringfacebookAppIdValue = getEnvironment().getAndroidManifest().getMetaDataQualifiedNames().get(FACEBOOK_APP_ID_NAME);
if (facebookAppIdValue == null) {
valid.addError(
"Your application must include the meta-data named " + FACEBOOK_APP_ID_NAME + "." +
"\nEx. <meta-data android:name=\"com.facebook.sdk.ApplicationId\"" +
"\n android:value=\"<Your Facebook App Id>\"/>"
);
}
finalStringFACEBOOK_LOGIN_ACTIVITY_NAME = "com.facebook.LoginActivity";
if (!getEnvironment().getAndroidManifest().getComponentQualifiedNames().contains(FACEBOOK_LOGIN_ACTIVITY_NAME)) {
valid.addError(
"Your application must declare " + FACEBOOK_LOGIN_ACTIVITY_NAME + " activity." +
"\nEx. <activity android:name=\"com.facebook.LoginActivity\"/>"
);
}
I did already an implementation for this feature, adding a getMetaDataQualifiedNames method to the AndroidManifest 86f6f18
There's many 3rd parties libraries that check for Meta-Data information, this would facilitate the integration and validations with such libraries.