Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to update ios6 enterprise apps over the air

Hello we have developed our first enterprise app recently. We are using the "In-House" option to create the distribution certificate. Client is not using the app yet. But he will be using it soon. Meanwhile i got a question. He will use the app and in future if there are any updates to the app from our side, we want the client to have it updated on his side as well . Like right now I have apps installed on my iPhone. I get update from AppStore saying the XYZ app has been updated. So i install the update. Now if our client is using the app and has saved some data on it(our app uses core data, and we built it in a way that client can store some data on the device) we want to send an update to him that would install the update, but not erase any existing client data.Is that possible? How do i do it?I am using over the air installation right now to install the app. We have a secure server, where the .ipa and .plist files are present and we have a download html page. Client clicks the link and the app gets installed. Please let me know if you need more information. Thanks.

like image 399
RookieAppler Avatar asked Dec 04 '12 20:12

RookieAppler


People also ask

How do I update my enterprise app?

Example of the Google Play Store app Settings screen. Under Settings, tap Network preferences, then tap Auto-update apps. Google Play Store settings screen. Select your auto-update preference.

How do I update the enterprise app on my iPhone?

Go to Apps tab > Click on the Enterprise app which is to be updated. Click on the Settings drop-down (gear icon) on the top-right corner of the app details box > Select Edit from the drop-down list. Click on the option Change beside the IPA file. Upload the new app version > Click Save.


Video Answer


1 Answers

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.

like image 197
Joe Avatar answered Oct 22 '22 07:10

Joe