Pass param to app when installed from Google Play

自闭症网瘾萝莉.ら 提交于 2019-12-31 14:34:18

问题


I need to support the following scenario:

User receives the e-mail with link to my app.

If user already has the app installed the link should open the app passing some data in the intent to the launcher activity.

If the app is not installed yet the e-mail link should act as campaign referrer: direct user to Google Play to install the app with referrer url that is passed to my app after installation in referrer broadcast receiver.


回答1:


You need to intercept the com.android.vending.INSTALL_REFERRER Intent, which is broadcast by Google Play after the app is opened for the first time after installation, and catch the data in that Intent. The parameters in the URI used to launch Google Play will be passed along in the referrer String extra. (Though you are limited to a list of allowed params, see the official docs for that table.)

https://developers.google.com/analytics/devguides/collection/android/v4/campaigns



来源:https://stackoverflow.com/questions/24350349/pass-param-to-app-when-installed-from-google-play

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