简体   繁体   中英

Track number of invites for android app

I have a client/server application.
It's an android app backed by php/MySQL server.

I need the user to be able to invite people to download the app
by sharing the download link, something like http://domain.com/invite.php?userid=12345
and track the number of people that have clicked on the link (on the server).

I could increment that number every time the link is clicked
but, obviously, the problem is that the user could click on its own link
and increase his/her score.

What is the best way to avoid cheating the invites system?

To me, these functionnalities are to be implemented on the server-side. Try to add another tag to your question. For example, you could have the possibility to create a UID for your user, and one for his phone, and then deny every request from his phone when attempting to hit his own link. Just an idea.

The most painless way would be to use cookies to track a re-visit, and possibly validate the User-Agent. It's fairly easy to fake headers though, so it's not the most secure approach.

Alternatively, have a validation page - eg the link you share goes to a page requesting either an email address or phone number, then you email or SMS the real link to the new user. This way, you can filter out duplicates fairly easily, at the cost of privacy issues.

There are lots of SMS gateway providers out there, and message costs are fairly low, although you need a paid app for this approach to make sense.

Hope this helps,

Phil Lello

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM