Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass param to app when installed from Google Play

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.

like image 820
user1744147 Avatar asked Jun 22 '14 10:06

user1744147


People also ask

Where do my apps go when I download them from Google Play?

You can see all the apps you've ever downloaded on your Android phone by opening the "My apps & games" section in your Google Play Store. The apps you've downloaded are divided into two sections: "Installed" (all the apps currently installed on your phone) and "Library" (all the apps that aren't currently installed).

How do I install an APK file from Google Play to my computer?

On your computer, go to play.google.com/googleplaygames. Click Download. To install the app, open the downloaded file, then follow the instructions on your PC. Installation can take a few minutes.


1 Answers

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

Edit: Google has announced in an email sent to developers that as of March 1, 2020, they will no longer be supporting this. Developers need to use the new API https://developer.android.com/google/play/installreferrer/library.html.

like image 193
Turnsole Avatar answered Sep 24 '22 18:09

Turnsole