/ Published in: Objective C
Implement this in YourAppController delegate class to check for an expiration date when the app is first initialized.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (id) init { self = [super init]; if (self != nil) { // If past expiration date, then pop up a dialog that says // the user needs to download a new version, quit the app, and // load the website for new downloads if ([now timeIntervalSinceReferenceDate] > [expire timeIntervalSinceReferenceDate]){ NSLog(@"Beta Expired"); if (NSRunAlertPanel(@"This beta of App has expired.", @"Please download a new version from\nhttp://appwebsite.com.", @"Go to the Download Page", @"Maybe Later", nil)) { [self openURL:@"http://appwebsite.com/"]; } } } return self; } // open URL in browser }