I am distributing the iPad application using apple's Distributing Enterprise Apps for iOS Devices.
In my app, it is very important to update the older version to prevent access of expired information. Hence, I have implemented app update mechanism as follow.
When user starts the app, each time I compare the installed build version code with one on the server by requesting the web service I have created and hosted on my own server. If there is update found, I ask user to upgrade the app via UIAlertView
and when user taps on Update button, I fire the URL which points to .plist on my server as suggested here.
NSString *appUpgradeUrl = [NSString stringWithString:@"http://domain.com/manifest.plist"];
NSURL *url = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"itms-services://?action=download-manifest&url=%@", appUpgradeUrl]];
[[UIApplication sharedApplication] openURL:url];
Now an UIAlertView
pops up on the screen and asks user for the confirmation with two buttons at the bottom, Cancel and Install. When user taps on Install, it simply gets replaced with newer version and when user taps on Cancel, it simply disappears and does nothing.
Now here is my question: I want to force user to update the app as I said, it is very important to update to newer to prevent access of expired information. Unfortunately, I am not able to do so. I want to get notified of Cancel button's click event so that I can force user to update the app by asking again for the app update via UIAlertView
. Can I do so?
Let me know if there is any better idea than this to force for updating the app.