Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Reading the Meta-Data information from AndroidManifest #1860

Copy link
Copy link
@smaugho

Description

@smaugho
Issue body actions

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:

        final String FACEBOOK_APP_ID_NAME = "com.facebook.sdk.ApplicationId";
        final String facebookAppIdValue = 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>\"/>"
                );
        }

        final String FACEBOOK_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.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.