Xiaomi referrer plugin

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 backend as part of the install payload.

The Xiaomi install referrer is available on all devices using the Xiaomi install referrer library.

Before you begin

Follow the 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

JAR file

Add the Xiaomi install referrer library

You must add the Xiaomi install referrer to your app to read the referrer value.

Maven

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 are not removed during build.

Add the following rule to keep all Adjust classes.

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

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

-keep class com.miui.referrer:homereferrer.** { *; }

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.

Java
Kotlin
AdjustXiaomiReferrer.doNotReadXiaomiReferrer();
//...
Adjust.onCreate(config);

To enable reading this information, call AdjustXiaomiReferrer.readXiaomiReferrer(applicationContext) before you initialize the SDK.

Java
Kotlin
AdjustXiaomiReferrer.readXiaomiReferrer(applicationContext);
//...
Adjust.onCreate(config);