I am trying to add daily checkin in my android app. In which user will be notified with 24 hours everyday. I am done with system date by adding 24 hours to current date and time but this fails when user manually change date into his device. What i need to do so that it get current date and time and add 24 hours and then after 24 hours it should notify users that 24 hours have competed.. Help please
Asked
Active
Viewed 481 times
-2
-
1Hi, Welcome to stack overflow. Please refer the [ask] link for more details on how to ask a question and update your question accordingly. – Jeroen Heier Jul 02 '17 at 07:02
1 Answers
1
There's no way to do this on the client device- they can always reset the time. You really have two options:
1)Generate these notifications on the server, and send them via push messaging.
2)Generate them on the client, but validate on the server that at least 24 hours have gone since the last time they checked in. If not, display an error message on the screen.

Gabe Sechan
- 90,003
- 9
- 87
- 127