0

We are not distributing our app from Google Play due to some policy violations and instead planning to put it on our own server for direct download.

I want to implement invite friends feature in android mobile app. My app user will invite his friends through a dynamic link shared similar to

 https://example.com/download_app?referred_by_user=12345678_john 

On clicking on that link, android apk will be downloaded from our own server, user will manually install it. When user open app first time after installing, i want to read the referred_by_user=12345678_john parameter from the referral link to validate it against our database users and then to award referrer user some points.

is there any way to achieve this without distributing app through Google Play?

Mayank Kumar
  • 313
  • 2
  • 13

1 Answers1

2

Unfortunately, unless you're also distributing your own version of the Play Store (which can broadcast this data via INSTALL_REFERRER parameter when you launch your app), I don't think there's a way to do this client-side.

What you can do is add either a mobile number or email address of the invited friend (depending on which one you use for sign-up in your app) as query parameter on your dynamic link. Now when the invited friend clicks on the link, your server can capture both referrer ID and his friend's phone number or email, and store that combination (we'll call this Referral Table), mark it as pending referral bonus. Now when anyone signs up you can query the number/email against the referral table, and when there's a match, you would know via referrer ID who invited this new customer.

Now this only works automatically when the link is dynamically generated for the referred friend. For public referral links you can maybe do something like capture the friend's IP address, or even have a form that the friend can fill up with his email/phone number before redirecting him to the apk.

josephus
  • 8,284
  • 1
  • 37
  • 57