Android - Pass data from link to app when installed and launched
Asked Answered
A

2

5

I want to implement an app invitation, which I can share to users via a link

Hi, you've been invited to so and so. Click here to accept! http://myapp.com/?foo1=bar1&foo2=bar2

The link itself will redirect to the google play store, but I want to keep the foo1 = bar1, foo2 = bar2. And when the application has been launched, I want to get that data and do something with it.

Is this at all possible?

If there's not, is there another way that I could go about this?

Thanks!

Avitzur answered 10/6, 2018 at 21:7 Comment(3)
What exactly are you trying to achieve?Latoyalatoye
To pass data in on a first install event. That way, I can still retain the invitation information and perform the necessary tasks.Avitzur
well if you want to do something of that effect you can simply use a sharedpreference to make sure the information is only asked once after fresh install. You can make the user pass the info or auto send the info to the user if that is what you want.Latoyalatoye
S
5

getting data from the download url

`https://play.google.com/store/apps/details?id=com.example.myapp&referrer=utm_content%3Dgroup232`

after first install, get the referrer and its content (eg. get "group232")

Check here for more details https://developer.android.com/google/play/installreferrer/library

Seamanship answered 30/5, 2019 at 8:19 Comment(0)
D
4

You could use the Google Play referrer API. There is a a library, the Play Install Referrer Library which wraps this in a slightly easier to use interface.

Deponent answered 11/6, 2018 at 7:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.