0

In an app I'm developing (In-App Purchase) I'm thinking on allow full access to the app the first week after first opening, so the users can fully evaluated it. Once this time has gone, only some functionalities will be enabled.

Which is the best way (and secure way to do that)? I've thought on save the first open date of the App on KeyChain but, what about change iPhone/iPad system date?

Thanks.

RFG
  • 2,880
  • 3
  • 28
  • 44

1 Answers1

1

When you write the parameter of "First time opened" don't write the device current date - get the date from the a Time Zone Location Web Services.

Take a look at this question and answer: How to get a time zone from a location using latitude and longitude coordinates?

Community
  • 1
  • 1
Gal Marom
  • 8,499
  • 1
  • 17
  • 19
  • Is a good solution but, what if the user if off-line? Can't check date and time. – RFG Jul 16 '14 at 17:17
  • Is your application an offline or online one? you can make sure that he is online (wifi/3g/4g) when he opens the application and if he's not online don't let him go ahead- if that works for you. another thing you can do is save the coordinates and check it once he's going online. – Gal Marom Jul 17 '14 at 09:34
  • Is an offline app. Well, connection is only used for IAP. Is there a way to check date (if there is a internet connection) if app is in background mode or (perhaps) not activated, so if the user goes to offline mode in order to avoid restriction, app can detect connection after? – RFG Jul 17 '14 at 12:28
  • I would do it like that: every time the applicationDidBecomeActive I check if the parameter firstDateUsed is nil. if it is I'm checking if you're offline. if it's the firstTimeRunning I'm saving the current location in the userDefaults. If he's online I'm checking if the location parameter is nil - if it's not I'm setting the firstTimeUse relating to that and set the location parameter to nil. else, I'm setting the first time use for the current location. It's not 100% I guess as a comment so if you need I will write my idea as a pseudo code as an edit to my answer – Gal Marom Jul 17 '14 at 13:26