The Xiaomi referrer plugin enables the Adjust SDK to read Xiaomi install referrer values on a device. The SDK then sends this information to the Adjust servers as part of the install payload.
The Xiaomi install referrer is available on all devices using the Xiaomi install referrer library.
Follow the Android get started guide to integrate the Adjust SDK in your app.
Install the Xiaomi referrer plugin
There are two ways to install the Xiaomi referrer plugin:
Maven
Add the following dependency to your build.gradle
file under your Adjust SDK declaration.
JAR file
The Xiaomi referrer plugin is available on the GitHub releases page.
Add the Xiaomi install referrer library
You must add the Xiaomi install referrer to your app to read the referrer value.
Maven
Add the following dependency to your build.gradle
file after the Adjust SDK.
For more information check out the Xiaomi install referrer library documentation.
Proguard settings
If you use Proguard, you must add rules to ensure that important classes aren’t removed during build.
Add the following rule to keep all Adjust classes.
Add the following rule to keep the Xiaomi install referrer library.
Use the plugin
The Xiaomi referrer plugin is active by default. You can enable or disable the reading of Xiaomi install referrer information using the AdjustXiaomiReferrer
class methods.
To disable reading the install referrer, call AdjustXiaomiReferrer.doNotReadXiaomiReferrer()
before you initialize the SDK.
To enable reading this information, call AdjustXiaomiReferrer.readXiaomiReferrer(applicationContext)
before you initialize the SDK.