OAID
Overview
Collect the Android Open Anonymous Device Identifier (OAID) to attribute installs from third-party Android app stores.
The OAID is a user-resettable unique identifier for Android devices. It was introduced by the Mobile Security Alliance (MSA), China Information and Communication Research Institute, and device manufacturers, as a privacy-preserving alternative to non-resettable device identifiers like IMEI.
Integration
Requires AppsFlyer SDK V5.4.0+
OAID integration consists of 3 steps:
- Integrating the AppsFlyer SDK in the
build.gradle
file of your project - Integrating the AppsFlyer OAID plugin module in the
build.gradle
file of your project
dependencies {
implementation 'com.appsflyer:af-android-sdk:6.9.4'
implementation 'com.appsflyer:oaid:6.9.0'
}
- Integrating an SDK to generate and provide the OAID (either the MSA SDK or Huawei HMS SDK)
Note:
- For apps that are intended to be used in China, the MSA SDK must be used.
- For apps that are intended to be used globally on Huawei devices, the Huawei HMS library should be used.
MSA SDK integration
To integrate the MSA SDK:
- Get from the marketer: The MSA SDK (aar) file and the certificate that needs to be integrated into the app.
- Copy the MSA SDK (aar) under the libs folder.
- Copy and paste
supplierconfig.json
under the assets folder of the project and make the necessary changes, such as updating the appid of your app in each of the stores. - Copy and paste the certificate file (bundle name.cert.pem) under the assets folder of the project.
- See full instructions on the MSA website
- Update the
build.gradle
file of your project as follows:
implementation 'com.appsflyer:af-android-sdk:6.9.4'
implementation 'com.appsflyer:oaid:6.9.0'
implementation files('libs/oaid_sdk_2.0.0.aar')
Huawei HMS SDK integration
To integrate the Hauwei HMS SDK:
- Add the Huawei maven repo as follows:
repositories {
maven {
url "https://developer.huawei.com/repo/"
}
}
- Update the
build.gradle
file of your app as follows:
dependencies {
implementation 'com.appsflyer:af-android-sdk:6.9.4'
implementation 'com.appsflyer:oaid:6.9.0'
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
}
Additional information
Opting out of OAID collection
To opt-out of OAID collection, use one of the following APIs:
- setCollectOAID as follows:
AppsFlyerlib.setCollectOaid(false);
- setDisableAdvertisingIdentifiers as follows:
AppsFlyerlib.setDisableAdvertisingIdentifiers(true);
Setting OAID manually
To manually set the OAID into the AppsFlyer SDK:
- Use the setOaidData API as follows:
AppsFlyerlib.setOaidData(oaid);
Updated 9 months ago