adjust-icon

Xiaomi referrer

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.

build.gradle
implementation 'com.adjust.sdk:adjust-android:4.38.5'
implementation 'com.adjust.sdk:adjust-android-xiaomi-referrer:4.38.5'

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.

build.gradle
implementation 'com.miui.referrer:homereferrer:1.0.0.6'

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.

Proguard.pro
-keep public class com.adjust.sdk.** { *; }

Add the following rule to keep the Xiaomi install referrer library.

Proguard.pro
-keep class com.miui.referrer.** {*;}

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.