Before using messaging feature in the sample app you need to follow the below steps to configure it:
- Configure Firebase project for the aep sample app using the firebase documentation
- Use
com.adobe.marketing.mobile.sampleapp
as the package name while creating the firebase android app. - Follow the Firebase documentation to download and overwrite the
google-services.json
configuration file in theSample-App/app
folder.
- Use
- Setup Journey Optimizer
- Update the
ENVIRONMENT_FILE_ID
constant value inSample-App/app/src/java/com/adobe/marketing/mobile/sampleapp/MainApp.Java
file with the config app id of the property. For more information on how to get the config app id from Data Collection check this document
To enable advertising identifier features in the sample app, follow these steps:
- Update the value for key
gms_ads_app_id
located in thesecrets.xml
at aepsdk-sample-app-android/Sample-App/app/src/main/res/values with a valid Google AdMob app ID.- See Google's quick start reference on how to get your AdMob app ID. See step 3 of the Configure your app section for a free public test app ID from Google.
- Any real key values in the
secrets.xml
file should not be committed to the repository.
- By default, the ad ID features are commented out in the sample app. To enable these features, uncomment the implemention code using find and replace all to replace all instances of:
/* Ad ID implementation
with:
//* Ad ID implementation
Each code block has a pair of block comments wrapped around it to enable this behavior:
/* Ad ID implementation (pt. 1/4)
<commented implementation code...>
/* Ad ID implementation (pt. 1/4) */
After replacement it will become:
//* Ad ID implementation (pt. 1/4)
<active implementation code!>
//* Ad ID implementation (pt. 1/4) */
For convenience, these are the default find and replace shortcuts in Android Studio:
The shortcut should open a window that looks like the following:
There should be 4 pairs of special comment blocks (8 total matches) across two files:
EdgeIdentityTab.java
and app/build.gradle
- With the implementation code and gradle files uncommented with new dependencies, sync the project with the Gradle file changes using: File -> Sync Project with Gradle Files
The app should now be properly configured to use advertising identifier features.
To disable these features, follow these steps:
- Find and replace all instances of:
//* Ad ID implementation
with:
/* Ad ID implementation
- Sync Project with Gradle files using: File -> Sync Project with Gradle Files