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-edgeidentity-android/code/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 5 pairs of special comment blocks (10 total matches) across two files:
app/build.gradle
, CustomIdentityFragment.kt
, and SharedViewModel.kt
- 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