Reputation: 47
I am working on android app that asking users to share this app to ten users to get a bonus. App can be shared via any app appearing in dialog. Now the problem is, I cannot determine that user has successfully shared my app to x number of users.
The simple code that I am using to share app is following.
Intent sharingIntent = new Intent(android.content.Intent.ACTION_SEND);
sharingIntent.setType("text/plain");
sharingIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "playstore link");
sharingIntent.putExtra(android.content.Intent.EXTRA_TEXT, getResources().getString(R.string.share_app_text));
startActivity(Intent.createChooser(sharingIntent, "Share app via"));
Upvotes: 0
Views: 63
Reputation: 6014
If you actually want to track if users installed an app after they received a shared link, you should give Firebase Invites a try. This is probably the most elegant way if you don't want to develop this functionality on your own.
Upvotes: 0
Reputation: 3903
Use UTM source.
1) Embade a UTM key unique to a particular user to the redirection URL.
2) when the user clicks on the share button, open that URL.
3) Host an HTML page at the server which opens from the aforesaid URL which will read that UTM code, create a mapping for that install and will redirect the user to the play-store URL.
Upvotes: 1
Reputation: 140427
I think the best you could get is: find a way to understand whether that "sharing" was actually succesfull (which could basically mean: in the end, the user clicked some OK button).
Then, persist that information.
In other words: you basically need a counter that gets stored, for example using Android's shared preferences (see here for a simple example).
The real problem might be that the "sharing" could be tricked easily. You know, like simply sharing to the same person on Facebook 10 times.
So, if you want something that is less easy to trick, you probably should count something else, like: you create a specific URL on a server of yours, and you count how many times that is visited (from different IPs for example).
Upvotes: 1