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:

  1. Integrating an SDK to generate and provide the OAID (either the MSA SDK or Huawei HMS SDK).
  2. Integrating the AppsFlyer OAID plugin module.
  3. Integrating the AppsFlyer 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:

  1. Get from the marketer: The MSA SDK (aar) file and the certificate that needs to be integrated into the app.
    1. Copy the MSA SDK (aar) under the libs folder.
    2. 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.
    3. Copy and paste the certificate file (bundle name.cert.pem) under the assets folder of the project.
    4. See full instructions on the MSA website
  2. 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:

  1. Add the Huawei maven repo as follows:
repositories {
  maven {
      url "https://developer.huawei.com/repo/"
  }
}
  1. 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:

AppsFlyerlib.setCollectOaid(false);
AppsFlyerlib.setDisableAdvertisingIdentifiers(true);

Setting OAID manually

To manually set the OAID into the AppsFlyer SDK:

AppsFlyerlib.setOaidData(oaid);