拦截INSTALL_REFERRER再往前就到谷歌AnalyticsReceiver [英] Intercept INSTALL_REFERRER and then forward on to Google AnalyticsReceiver

查看:191
本文介绍了拦截INSTALL_REFERRER再往前就到谷歌AnalyticsReceiver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个安装接收器,以确定何时应用程序已经通过市场进行安装。不过,我也想通过INSTALL_REFERRER广播到 AnalyticsReceiver 如果已安装的应用程序内的其它接收器,如谷歌Analytics(分析)。重要的是,我不知道是否安装了其它接收机作为我的接收器将他们的应用程序中使用其他开发人员。

I have written an install receiver to determine when an app has been installed via the Market. However, I also want to pass the INSTALL_REFERRER broadcast onto other receivers such as the Google Analytics AnalyticsReceiver if it is installed within the app. Importantly, I do NOT know if other receivers are installed as my receiver will be used by other developers within their apps.

目前,我收到了广播和完整的,当我打电话:

Currently, I receive the broadcast and when complete I call:

AnalyticsReceiver接收器=新AnalyticsReceiver();

receiver.onReceive(背景下,意图);

问题是 AnalyticsReceiver 类可能不是present。

The issue is the AnalyticsReceiver class may not be present.

那么,如何通过在广播,如果我不知道应用程序是否使用了 AnalyticsReceiver

So how do I pass on the broadcast if I'm not sure whether the app uses the AnalyticsReceiver?

或者将Android本身确保安装在每个接收端收到的广播?

Or will Android itself make sure each receiver installed gets the broadcast?

非常感谢!

推荐答案

这并没有真正回答这个问题,但唯一的预期目标为 INSTALL_REFERRER 是谷歌Analytics(分析)库,因此大约有包含在广播中的数据零担保(或有关广播为此事任何东西),所以你不应该依赖它。

This doesn't really answer the question, but the only intended destination for INSTALL_REFERRER is the Google Analytics library, and thus there are zero guarantees about the data contained in the broadcast (or anything about the broadcast for that matter), so you shouldn't rely on it.

在一个侧面说明,这里有一些相关的S.O.问题:

On a side note, here are some related S.O. questions:

  • Get Android Google Analytics referrer tag
  • Get referrer after installing app from Android Market

这篇关于拦截INSTALL_REFERRER再往前就到谷歌AnalyticsReceiver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆