Reputation: 91
I'm recreating Yik Yak mobile application as a web application in process of learning Meteor framework. But that app is completely anonymous without user accounts, but still you can upvote or downvote post only once. How to make this work ?
Upvotes: 2
Views: 1003
Reputation: 29645
What you want will probably require more than just JavaScript, and some back-end code (with the language of your choice).
If it's a website, you can try to identify a user by the IP/MAC address of his/her computer. But the problem is that it is not going to be reliable (e.g.: users could hide behind fake addresses, or multiple users could use the same IP). You can read about some methods on this question (PHP).
If it's a mobile application, use the unique device ID (but again, that will require more than plain JavaScript).
Settings.Secure#ANDROID_ID
(read more on this question)[UIDevice currentDevice] uniqueIdentifier
(read more on this question)DeviceExtendedProperties.GetValue("DeviceUniqueId")
(read more on this question)device.uuid
to get a unique identifier (read more here)With the unique device ID (UDID), you can identify what device voted, without knowing who is the owner of that device and without forcing your users to create an account/log in.
Upvotes: 2