如何通过无线方式更新ios6企业应用程序 [英] How to update ios6 enterprise apps over the air

查看:168
本文介绍了如何通过无线方式更新ios6企业应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我们最近开发了第一个企业应用程序。我们使用内部选项来创建分发证书。客户端尚未使用该应用程序。但他很快就会使用它。与此同时,我有一个问题。他将使用该应用程序,并且将来如果我们的应用程序有任何更新,我们希望客户端也在他身边更新它。就像现在我在我的iPhone上安装了应用程序。我从AppStore获得更新,说XYZ应用程序已更新。所以我安装了更新。现在,如果我们的客户端正在使用该应用程序并在其上保存了一些数据(我们的应用程序使用核心数据,并且我们以客户端可以在设备上存储某些数据的方式构建它),我们希望向他发送将要安装的更新更新,但不删除任何现有的客户端数据。这可能吗?我该怎么做?我现在正在使用无线安装来安装应用程序。我们有一个安全的服务器,其中存在.ipa和.plist文件,我们有一个下载html页面。客户端单击该链接并安装该应用程序。如果您需要更多信息,请与我们联系。谢谢。

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.

推荐答案

是的,这是可能的。部署企业应用程序时,它需要包含有关应用程序元数据的plist。此元数据包括可用于检查更新的版本号。

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;
}

一旦检测到更新可用,请将用户导航到下载URL

Once you detect the update is available navigate the user to the download URL


itms-services://?action = download-manifest& url =< url-path-to-plist> ;

它将安装在现有版本上,保留所有数据,甚至升级CoreData数据库,如果您设置自动迁移并进行更改。

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.

这篇关于如何通过无线方式更新ios6企业应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆