The OAID (Open Anonymous Device Identifier) is a unique identifier for Android devices. The MSA (Mobile Security Alliance) 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. The OAID is readable on all devices using the MSA SDK or HMS (Huawei Mobile Service) Core SDK on Huawei devices.
Add the plugin to your app
Install standalone binary
You can also add the plugin as a standalone binary from the releases page.
Use the plugin as a Prefab
You can load the OAID plugin as a Prefab on Unity apps. The standalone binary includes a Prefab folder containing this information.
To load the OAID plugin as a Prefab:
- Locate the Prefab in the
AdjustOaid/Prefab
folder. - Untick the Start Manually option.
- Tick the Read Oaid option.
Add the MSA SDK to your app
Requirements
MSA SDK version | Adjust OAID plugin version |
---|---|
v1.0.10+ | v4.19.0+ |
v1.0.12+ | v4.22.0+ |
v1.0.13+ | v4.23.0+ |
v1.0.23+ | v4.24.1+ |
v1.0.25+ | v4.27.0+ |
v1.0.26+ | v4.28.4+ |
v1.1.0+ | v4.28.9+ |
v2.0.0+ | v4.33.0+ |
To enable the OAID plugin to read OAID values from the MSA SDK, you need to add it to your project. To do this:
- Copy the MSA SDK (AAR file) to the
libs
directory of your project and set the dependency. - Copy the
supplierconfig.json
file to theassets
directory of your project. - 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:
- Add the Huawei maven repository.
- Add the HMS Core SDK.
Proguard settings
If your app isn’t targeting the Google Play Store, you don’t need to add all the rules set out in the Android get started guide. You can remove rules related to Google Play Services and install referrer libraries. You only need to keep the rules that apply to the Adjust SDK.
If you are adding the MSA SDK AAR as a dependency, add the following rules:
Use the plugin
Once you have set up the plugin, you can gather the device’s OAID. To do this, call the AdjustOaid.readOaid(applicationContext)
method before starting the Adjust SDK.
If you want to prevent the SDK from reading the OAID, call the AdjustOaid.doNotReadOaid()
method.