What's the recommended way to expire a beta Mac OSX app within a certain timeframe (i.e., 14 days) and then ask the user to update (in Cocoa)?
Do I just do date calculations every time the user launches the app? Also, is there a way to enable to updating using the Sparkle framework if the timeframe has expired?
Thanks
I think for a beta that will definitely expire on a given date, you can just hardcode that date. Then you can compare like:
NSDate* expirationDate = [NSDate dateWithString: @"2012-03-24 10:45:32 +0600"];
if ([expirationDate compare:[NSDate date]] == NSOrderedAscending) {
//is expired -> present update recommendation
}
If you want to be flexible with the date you could for example create a .txt file on your server wich contains a date-string. That could be easily loaded with:
NSString* dateString = [NSString stringWithContentsOfURL:myURL encoding:NSUTF8StringEncoding error:NULL];
NSDate* expirationDate = [NSDate dateWithString: dateString];
It sure would be nice, if you automatically present a sparkle update prompt. You can turn off automatic update checking (see: https://github.com/andymatuschak/Sparkle/wiki/make-preferences-ui ) and then, when the beta time is expired, manually perform an update check and/or reactivate the auto checking. (see: https://github.com/andymatuschak/Sparkle/wiki/customization )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With