adjust-icon

OAID plugin

The Open Anonymous Device Identifier (OAID) is a unique identifier for Android devices. The Mobile Security Alliance (MSA) recommends all Chinese-manufactured devices provide an OAID. You can use the OAID to attribute and measure devices where Google Play Services isn’t available.

The OAID plugin provides the OAID of a device. The SDK will continue to use other identifiers as well as the OAID.

Add the plugin to your app

The Adjust OAID plugin for React Native is available from npm.

npm
$ npm install react-native-adjust-oaid --save

Add the MSA SDK to your app

Requirements

To enable the OAID plugin to read OAID values from the MSA SDK, you need to add it to your project. To do this:

  1. Copy the MSA SDK (AAR file) to the libs directory of your project and set the dependency.
  2. Copy the supplierconfig.json file to the assets directory of your project.
  3. You can find the MSA SDK and detailed instructions at the MSA website.

Add the HMS Core SDK to your app

You can use the HMS Core SDK to access the OAID of Huawei devices. To enable the Adjust OAID plugin to read values from the HMS Core SDK, update your build.gradle as follows:

  1. Add the Huawei maven repository.
build.gradle
repositories {
maven {
url "https://developer.huawei.com/repo/"
}
}
  1. Add the HMS Core SDK.
build.gradle
dependencies {
implementation 'com.huawei.hms:ads-identifier:3.4.56.300'
}

Use the plugin

Once you have set up the plugin, you can gather the device’s OAID. To do this, call the AdjustOaid.ReadOaid method before starting the Adjust SDK.

import { AdjustOaid } from "react-native-adjust-oaid";
AdjustOaid.readOaid();
// ...
Adjust.initSdk(adjustConfig);

To stop the SDK from reading OAID values, call the AdjustOaid.doNotReadOaid() method.

import { AdjustOaid } from "react-native-adjust-oaid";
AdjustOaid.doNotReadOaid();
// ...
Adjust.initSdk(adjustConfig);