Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
12/09/14 07:25 PM (9 years ago)

Question on Date Changes

Hey guys, quick question. Is there a way to detect if the user has changed the date/time on their device? I'm working on a game, but simply changing the date on the device gives them all kinds of goodies that they shouldn't have for weeks. ;) I'm basically looking for a code snippet that will pop up a message informing them that the date on their device may not be correct, and will lock them out until they fix it. Tried google, but came up empty. I'd also prefer not to use an online source to get the time/date, for multiple reasons. Any ideas?
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
12/10/14 11:01 PM (9 years ago)
Interesting issue. Depending on 'how bad' you want it, you might consider creating a little class that can seek 'network time protocol' (NTP) and utilize that rather than built in settings... When the user first opens the app, have it 'write' the NTP percieved time/date to NSUserDefaults, and then each time the app is launched, it can do a network comparison, rather than a device comparison. Just a thought... Cheers! -- Smug
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.