Do not install Android Market INSTALL_REFERRER on Android 3.x

I have implemented BroadcastReceiver for Android Market INSTALL_REFERRER Intent as described here:

Get referrer after installing the application from the Android Market

It works great for Android devices above 3.0, but never works on Honeycomb devices. I checked the logcat output during installation and after the first launch of the application, and I do not see any of my debug output, which makes me think that BroadcastReceiver is not starting (I see the output on the pre-Honeycomb version).

Can anyone confirm this problem?

Any idea how to make it work?

+6
source share
2 answers

A new flag FLAG_EXCLUDE_STOPPED_PACKAGES in version 3.1 will appear:

If set, this intent will not match the components in packages that are currently stopped. If this is not specified, the default behavior is to include such applications in the result.

From the release notes for 3.1 :

Please note that the system adds FLAG_EXCLUDE_STOPPED_PACKAGES to all broadcast items.

And:

Applications are stopped when they are first installed, but not yet launched and when they are manually stopped by the user (in the Application Management section).

This seems to violate the behavior of INSTALL_REFERRER on devices 3.1+, since your application is not already running and therefore cannot receive the broadcast. Unfortunately, I do not know how to do this. Google could probably do something to fix this in its Market app (one way would be to just use FLAG_INCLUDE_STOPPED_PACKAGES , although I'm not sure what a great idea given all these new launch controls are).

+4
source

Since I experienced the translation Intent * INSTALL_REFERRER * was launched once before , the application was launched for the first time . If you don't catch him, you can never get him again

+1
source

Source: https://habr.com/ru/post/894565/


All Articles