Yes, it is possible. When you deploy an Enterprise application it requires a plist that contains metadata about the application. This metadata includes the version number that you can use to check for updates.
BOOL updateAvailable = NO;
NSDictionary *updateDictionary = [NSDictionary dictionaryWithContentsOfURL:
[NSURL URLWithString:@"http://www.example.com/pathToPlist"]];
if(updateDictionary)
{
NSArray *items = [updateDictionary objectForKey:@"items"];
NSDictionary *itemDict = [items lastObject];
NSDictionary *metaData = [itemDict objectForKey:@"metadata"];
NSString *newversion = [metaData valueForKey:@"bundle-version"];
NSString *currentversion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
updateAvailable = [newversion compare:currentversion options:NSNumericSearch] == NSOrderedDescending;
}
Once you detect the update is available navigate the user to the download URL
itms-services://?action=download-manifest&url=<url-path-to-plist>
and it will install over the existing version leaving all data in-tact and even upgrade the CoreData database if you setup auto migration and make changes.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…