Search code examples
androidandroid-studioreferrals

How do I implement a referral module onto my android application?


I want to implement a refer-a-friend kind of functionality onto my application such that every user will have a unique link directing to the apk and the user can share the link via different mediums. I am done with the generating link part, now I wanted to know how to identify the user hitting the link and also check whether or not the app was installed/downloaded. If it was installed, then I need to add some credits onto the link owner's account. And my issue needs to be resolved without the use of API's. Any help would be appreciated.


Solution

  • For every user you need to have a unique code stored on your server, like A has FOO766, A has BAR456.

    1. You can use Google's referrer feature. In this method, when you A shares your app to another user, you need to append a A's unique code with your app's Play store link. And when another user installs your app, a BroadcastReceiver of your app will be called, containing the code; with which you can verify referral. More info Google Campaigns.

    2. Or you can do it manually. Whenever a user installs your app, ask him for the referral code, and you can verify the referral condition's over the server & can determine is it valid or not.