Limit the use of the iOS application by date

In a few weeks, I will give the iOS application to a group of beta testers. I allow them to take the test from Friday evening until the next Sunday night. I want to ban any use after this Sunday. I do not want to use it NSDate, because testers can change the date on their device and continue to play after the end of the session. Any ideas?

+3
source share
6 answers

The date parameter is probably good enough, since most people will not want to change the date on their device, this will spoil too many other applications. The only case to worry about is someone who has a device dedicated to your game.

: , , , .

+3

, , , NSDate:

  • NSDate, - ( )
  • , , , , /. , , .

, .

+3

, , . , :

1: .

2: ... , userDefaults (, ). , . , .

+1

, . , , plist .

0

. , BETA . , , -, , . , .

, . - , , - . - /. , .

, , . . /, / . 10 , . , HTTP-.

0

, NTP:

https://github.com/jbenet/ios-ntp

, [NSDate networkDate];

appDelegate. - iPhone iPad:

if ([[NSDate networkDate] compare:startDate] == NSOrderedAscending) {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Beta Not Started" message:@"Beta starts [[STARTDATE]]." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertView show];

    return NO;
} else if ([[NSDate networkDate] compare:endDate] == NSOrderedDescending) {
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Beta Ended" message:@"Beta ended [[ENDDATE]]." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alertView show];

    return NO;
}

Then in your UIAlertViewDelegate:

- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    exit(0);
}

Hope this helps!

0
source

All Articles