开发者

Don't get Android Market INSTALL_REFERRER on Android 3.x

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 dur开发者_运维问答ing 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?


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).


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜