Apps such as FML, TWI etc that display user supplied data have the ability to upvote and downvote submissions such as “I agree”, “I disagree”, “like”, “dislike”.
Users are able to vote regardless if they are logged into the app in any means. Anonymous users can vote and it stores their vote for that post/entry.
I have no problem with incrementing the up or down votes on my server database when a public user votes but how do these applications keep track of a user’s votes within their app so that they can not keep giving upvotes again and again for the same item and can also visually show which way they voted if they go into that submission again?
I won’t be storing on my server which items a user has voted on and which direction the vote was as these are not registered/logged in users.
Any idea how I can implement this?
Thanks
Each item must have some sort of ID right? Save that in your app along with their vote. If the ID exists in your store, don’t allow them to vote, if it doesn’t exists, allow them to vote.