6

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

Get referrer after installing app from Android Market

It works fine for android devices earlier than 3.0 but it never seems to fire on Honeycomb devices. I've checked the logcat output during the install and after the app's first launch and I don't see any of my debug output which leads me to believe that the BroadcastReceiver isn't being run (I do see the output on pre-Honeycomb versions).

Can anyone out there confirm this problem?

Any idea how to make it work?

Community
  • 1
  • 1
Some Coder
  • 61
  • 2
  • `INSTALL_REFERRER` isn't part of the Android SDK, and Google has told developers [not to rely upon it](http://stackoverflow.com/questions/4984036/intercept-install-referrer-and-then-forward-on-to-google-analyticsreceiver). In fact, I would not be the least bit surprised if this has been explicitly disabled for security reasons. – CommonsWare Aug 08 '11 at 19:26

2 Answers2

4

There's a new flag called FLAG_EXCLUDE_STOPPED_PACKAGES in 3.1:

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

From the release notes for 3.1:

Note that the system adds FLAG_EXCLUDE_STOPPED_PACKAGES to all broadcast intents.

And also:

Applications are in a stopped state when they are first installed but are not yet launched and when they are manually stopped by the user (in Manage Applications).

Seems like this is breaking the behavior of INSTALL_REFERRER in 3.1+ devices as your app has not yet been launched and so can not receive the broadcast. Sadly I don't know of any way to make this work. Google could probably do something to fix this in their Market app (one way would be to just use FLAG_INCLUDE_STOPPED_PACKAGES though I'm not sure that would be a great idea, given the whole point of these new launch controls).

kabuko
  • 35,009
  • 7
  • 75
  • 92
1

As i experienced the Broadcast Intent *INSTALL_REFERRER* is fired once before the Application is launched the first time If you don't catch it there, you'll never get it again

martyglaubitz
  • 942
  • 9
  • 20