How to pass a tracking ID to the apk on install - android

Simple as this,
My affiliates send users to my app in google play,
on install my app picks up who sent that install.
Is that even possible?
Example:
https://play.google.com/store/apps/details?id=com.netmarble.mherosgb&someid=AFFILIATEID
I know I can have GA but I dont need that, I need my application to "know" exactly who sent the user who installed it.

InstallReferrerReceiver is broadcast which will fire when an app is installed from the Google Play Store
In onReceive method takes the referrer extra from the intent and breaks it down into key/value pairs to get all data from url.
See following example for more help:
Tracking install sources for Android apps

As per my understanding for your requirement it's seems to be not possible, Rather than you can do following things,
1) provide extra reference code field with your current field on registration page.
2) After registration provide each user unique code(via email or sms) and stored the same against the user registration details.
3) When user want to refer your app then user will provide there reference code to other user.
4) At time of registration user put that code in reference code field so it will become easy for you to know which user refer new user at time of its registration.

Related

How to remeber users without sign up in android?

Im working on a project where a user isn´t forced to sign up a account.
My plan is that a user could do anything like a user that is registered except for a few exceptions.
I implement a like function which saves the users behaviour on a webserver and later when the data is fetched again it recognized if the user liked something or not. My problem is that I have to save this informations also if the user isn´t registered to my application. A User should be free to decide wheter the user likes to sign up or not and isn´t forced to be a registered user.
I found three different way that could work!
1. Option
First option would be the accountmanager but I don´t like this option at all cause I have to ask for the contact permission and also ask which account a user want to use.
2. Option
A other option would be if a user starts the app for the very first time the app would call a server which creates a random unique code and send that code to my application to save it as key for the users actions which is saved on a server. But that also doesn´t seems to be a good solution for my problem.
3. Option
The last option would be oauth but for now I don´t know if and how it would be the solution to my problem!
I would be thankful for every answer!
I have worked on a comic app that requires saving the user subscribed channels, genre or comics and save the likes/dislikes for the same. User can be subscribed to push notification too.
For this, we used Firebase Authentication (anonymous signup). And to save the user subscription information, we used Firebase Firestore.
And followed the below approach.
As soon as the app opens, check if the user has already anonymous SignIn. If it hasn't, signUp silently.
Add a listener for user push notification token change. And update it to Firestore by anonymous user-id as key (We did same for storing other information too).
I think this approach would help to solve this problem.
You could use firebase auth for that!
Usually, you would use it with email & password or google login but it also has an anonymous login feature that should save the user's phone.
There are few techniques. It depends on whether you want to recognise a user between installations of app. If you are OK to lose a user on reinstallation you can use Firebase installation ID and link users behaviour with this id. If you want to remember users even between installations you can use unique to each combination of app-signing key, user, and device Secure.ANDROID_ID(more info about ids). But still the best way is implementing your own signing in or using of AccountManager.

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.
For every user you need to have a unique code stored on your server, like A has FOO766, A has BAR456.
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.
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.
You can achieve this without api.
Create one Label which consist some data.
Now add Scheme for that at your application (Manifest).
After that write code at First screen which get value from that label.
https://developer.android.com/training/basics/intents/filters.html
FYI :
Myapp

How do i track app installs in android

We are making an android app which will reward user for inviting their friends. we are having hard time to achieve this.
I know some apps are doing this referral and invite system where a user share his unique referral link and his friend click and install the app , when his friend done installing the app the user gets it reward.
I don't understand how it works. Please Explain.
for example, this is a referral campaign of amazon app and my friend told me to install it via this link so that he will get my referral. http://mcent.com/ref/8ZR287/
After thinking about this, here are my two cents:
In your application, as soon as the user installs the app, you can probably make an API call to YOUR server - where you keep track of installs?
Now, you will need to find away to get the Referral Code which will help you ID the referrer in your server for a reward.
Perhaps in that same table (in your server), each time you get notified of a referral, you increment a counter and reward the referrer?
Obviously, you need to generate a new referral code each time a new user installs your APP - might have to ID the device KEY that is unique. Then their email address? I am sure there is more to this!
I hope this helps! Good luck and let me know how it goes!

In Android, ensuring only pre-decided users can only use the app

I'm making an app, which I will distribute via playstore. However, though the app can be installed by anyone in the world, it can only run for selected users who I know.
Below are the possible ways I have figured out,
Check the account E-Mail ids on the phone and if that matches with the one's saved within the app code.
Check the mobile number on the phone and see if that matches with the one's saved within the app code.
When the app runs for the first time, it will send an SMS to my phone. I will reply to that SMS either saying YES or NO. If I reply YES then only the app will run for that user, else it will not.
I would like your feedback on these mechanisms. If there are other ways let me know about that too.
Thanks...
I think your best options are:
Make users log-in using an e-mail and a password (you could ask the user to register and if he uses an e-mail that is known to you, send a password to that e-mail [make the user change it later though])
Beta testing - This allow you to choose wich users will be able to install your app by creating a community on Google+ to beta test your app.
Maybe both.

List of Installed App From Google Play Against Google Account

Following are my problems:-
Is it possible to get the list of applications that a user has installed, against their google account through Google Play, programmatically through the use of any api?. Please note that I am not asking about the list of apps currently installed in the device, but ones that have at some point been installed.
I need a solution to the above as I am thinking of a scenario in my app, which is:
I want to give my app to the user for free during the first three months, after three months if user uninstalls the app and then installs it again I want to detect through any api (from Google Play) that the user has installed the app a second time (and should not get any free usage). Please note that I don't want to use any web service to store the account id & device id of the user at my side.
For option 2, you can create a file on the SD card. This will remain there when the user uninstalls/installs. But the user can always delete your special file. Unless you do something at your side, you are never sure if the user already used your app before.
To be completely sure, store it online:
You will need to have a very simple database which holds a list of device_id that installed your app.
Further more a webpage which fills this database.
In your app you download/open this webpage which the webpage will fill the DB.
App > WebClient (or other) which opens http://www.example.com/registerDevice.php?device_id=. The php site fills the db.
You app will need to check the database if the current device already has installed this app inorder to work/not work. You can do this via the same php and check the response. You could for example return 'ok' or 'not ok' or something else.
The simplest method is to get the account of the user the first time he/she runs the app, and send that detail over to you.
How this is can be done is well-documented over here: How to get the Android device's primary e-mail address
You will have to add another line of code to check back to the database at the first start of the app.
EDIT: For a non-web solution, simply add a timer to the start of your app:
schedule(TimerTask task, Date when)
the task should be adding a token AFTER the period of time you wish to give, to the phone's memory with the user's account details for authentication (see first solution on getting the account details)
Finally, as above, add a check-back to the phone's memory for that particular file to see if the user has used the app before.
The problem with any type of authentication that is based on the phone's memory is that people can easily remove the token, if they can find it, and reuse the app again.
Try this device specific implementation:
PackageManager packageManager = getContext().getPackageManager();
List<ApplicationInfo> applications = packageManager.getInstalledApplications(
PackageManger.GET_UNINSTALLED_PACKAGES);
// retrieves some information about all applications (even uninstalled ones)
// which have data directories
Of course this method won't work if user replaces the device. But you don't need to use any web service.
You can use this by keeping a database of hashed device id and users google id on a 3rd party server.
Also see http://android-developers.blogspot.de/2011/03/identifying-app-installations.html

Categories

Resources