You can use manifest merging to support different application keys for your build types (e.g. debugging or release) or your products (e.g. free or paid).
To support various application keys for your build types:
- Create
src/debug/AndroidManifest.xml and src/release/AndroidManifest.xml . - Remove the metadata tag from
src/main/AndroidManifest.xml . - Add the appropriate metadata tag to your assembly type manifest.
src/debug/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app" > <application> <meta-data android:name="LOCALYTICS_APP_KEY" android:value="DEBUG_APP_KEY" /> </application> </manifest>
src/release/AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app" > <application> <meta-data android:name="LOCALYTICS_APP_KEY" android:value="RELEASE_APP_KEY" /> </application> </manifest>
For different application keys based on your product tastes, simply replace debug and release above with your product taste names.
source share