Intercept INSTALL_REFERRER and then forward on to Google AnalyticsReceiver

吃可爱长大的小学妹 提交于 2019-12-01 04:10:36
Roman Nurik

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.

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

Roman's answer is not entirely correct. They don't go into step by step instructions, but Google themselves recommend using your own broadcast receiver if you need to. I do think they added this blurb recently, but not sure when. I'm pretty positive it did not exist when I answered one of the questions he links.

From their guide:

Note: Only one BroadcastReceiver class can be specified per application. Should you need to incorporate two or more BroadcastReceivers from different SDKs, you will need to create your own BroadcastReceiver class that will receive all broadcasts and call the appropriate BroadcastReceivers for each type of Broadcast.

This also seems to answer the question of whether you can blindly re-broadcast, at least according to Google.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!