开发者

How to enforce time based license in an iPad app

We're in the process of completing an application which is based on a licensing system. Users manage it thr开发者_StackOverflow中文版ough a web interface and can then sync their devices as they require. So once the device is sync'd the app is self sufficient to the point where the user needs to update their device with the latest set of data.

Now we have implemented the sync-process to verify if the user's license has expired or not before sync'ing. But the downside is that the updates aren't required that often and are more or less static over the period of our licenses.

As such, we're trying to figure out if it is possible on the device itself, to force the user to either sync up to our server at regular intervals or when the license is supposed to expire.

NSDate is an obvious no since its values are dependent on the user so can be changed easily. mach_absolute_time() was another option we considered but the timer changes when the iPad is restarted. We need some way to track absolute time since the license begun, regardless of whether the application or device were running or not and notify the user of this when the app starts.

Any help would be much appreciated.


Interesting problem. You could keep a NSUserDefaults value that represents the highest date that the app was run to detect if the user has changed the device clock. You could also build in a service client to go out and check an external server for the current time when the network is available. Doing this you're looking outside of the user's control to find the true time.

If the user is off the network you won't get a time, but with these devices they are on the network pretty often. You could also trigger the external time lookup when the device has a significant location change. That capability is described in the Apple documentation regarding multi-tasking options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜