android - 不要在 Android 3.x 上获取 Android Market INSTALL_REFERRER

标签 android installation google-play referrer

我为 Android Market INSTALL_REFERRER Intent 实现了一个 BroadcastReceiver 作为 此处描述:

Get referrer after installing app from Android Market

它适用于早于 3.0 的 android 设备,但它似乎永远不会在 Honeycomb 设备上触发。我在安装期间和应用程序首次启动后检查了 logcat 输出,但我没有看到任何调试输出,这让我相信 BroadcastReceiver 没有运行(我确实看到了 pre-Honeycomb 上的输出版本)。

有人可以确认这个问题吗?

知道如何让它发挥作用吗?

最佳答案

有一个名为 FLAG_EXCLUDE_STOPPED_PACKAGES 的新标志在 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.

来自release notes for 3.1 :

Note that the system adds FLAG_EXCLUDE_STOPPED_PACKAGES to all broadcast intents.

还有:

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

这似乎打破了 3.1+ 设备中 INSTALL_REFERRER 的行为,因为您的应用尚未启动,因此无法接收广播。可悲的是,我不知道有什么方法可以完成这项工作。 Google 可能会在他们的 Market 应用程序中做一些事情来解决这个问题(一种方法是只使用 FLAG_INCLUDE_STOPPED_PACKAGES,但考虑到这些新启动控件的全部意义,我不确定这是否是个好主意)。

关于android - 不要在 Android 3.x 上获取 Android Market INSTALL_REFERRER,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6985775/

相关文章:

android - 基准测试电池安卓

java - Android - 使用两个 xml 文件显示单个 Activity

java - Genson 中类元数据的顺序很重要 - 有解决方法吗?

r - 安装制表程序包时出现问题

apache - 在 TOMCAT 7 上安装 Apache Archiva 作为 Web 应用程序

android - Google Play 商店源代码

android - 有没有办法以编程方式在 google play 开发者控制台上获取评论?

android - 在 Android 上启动协程的正确方法是什么?

android - Google Play广告SDK问题

python - 如何在 CentOS 6.4 上安装 urwid 1.1.1?