To avoid situations where two or more SDKs might compete for the INSTALL_REFERRER
Intent, you should create a single BroadcastReceiver class and rebroadcast to other
BroadcastReceivers.
can function alongside
another user acquisition/attribution solution on Android (e.g. DoubleClick), but
this requires an additional step during integration. Android permits multiple
BroadcastReceivers to register for the same INSTALL_REFERRER Intent. But the two
BroadcastReceivers can sometimes conflict with each other.
-
Create a class according to the following guide, substituting the correct
information.
public class ReferralReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Receiver1 receiver1 = new Receiver1();
receiver1.onReceive(context, intent);
Receiver2 receiver2 = new Receiver2();
receiver2.onReceive(context, intent);
}
}
-
In AndroidManifest.xml, pull referrer data from the class.
<receiver android:name="your_package_name.ReferralReceiver" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>