Using Multiple Android Install Referrers

If your Android app has multiple receivers for INSTALL_REFERRER for Google Play, then you need to write a custom receiver that calls these receivers.

The following code shows an example of creating a new receiver class.

import com.tune.TuneTracker;
 
public class MyReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        TuneTracker tracker = new TuneTracker();
        tracker.onReceive(context, intent);
 
        // Initialize and call onReceive for other receivers.
        // These might include Google Analytics and your own handler.
    }
}

Then place the receiver in your manifest file as shown in the following code example (but change the receiver name to the one you created above).

<receiver android:name="com.mypackage.MyReceiver" android:exported="true">
    <intent-filter>
        <action android:name="com.android.vending.INSTALL_REFERRER"/>
    </intent-filter>
</receiver>

If an Install Referrer is not working/tracking properly, then please visit Testing the Google Play Install Referrer.

For Plugins:

If you’re using one of the supported plugins, you still need to write a custom receiver in Java, but then export it into a .jar file to be included in the manifest file in your plugin of choice. Please refer to that plugin’s documentation as to the location of the manifest file.

Have a Question? Please contact support@tune.com for technical support.