Install_referrer Not Received Before Application Launched
I want to catch INSTALL_REFERRER intent at my own receiver. I implemented receiver public class InstallReferrerReceiver extends BroadcastReceiver { @Override public void
Solution 1:
On Android 3.1+ application's BroadcastReceiver (or any other component) will not be fired until user has launched the application at least once. Until then it is in the "stopped" state
That is an intended behaviour and prevents some security risks.
Solution 2:
you must set flag Intent.FLAG_INCLUDE_STOPPED_PACKAGES
when send broadcastintent
.
Bundleextras=newBundle();
extras.putString("referrer", referrer);
Intentintent=newIntent("com.android.vending.INSTALL_REFERRER");
intent.putExtras(extras);
intent.setPackage(packageChanged);
intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES);
sendBroadcast(intent);
Solution 3:
You adb command is not complete. Try with this one:
./adb shell am broadcast -a com.android.vending.INSTALL_REFERRER -n <your package>/<your package>.receiver.InstallReferrerReceiver --es "referrer""utm_medium%3Dpartner%26utm_campaign%3Dpartner_name"
Note: the referrer should be url encoded.
Post a Comment for "Install_referrer Not Received Before Application Launched"