企业iOS应用程序的分发

时间:2016-02-18 09:36:22

标签: ios iphone app-store enterprise software-distribution

我有一个iOS应用程序,将在公司员工之间分发。我知道为此我们需要使用企业开发者帐户。我怀疑的是我将如何分发构建。 apple是否提供企业商店?如果不是假设我通过像diawi.com这样的服务分发构建,那么如何安装更新。当我推出更新时,用户是否应删除旧版本,然后重新安装。

我试图在很多地方搜索,但我无法得到明确的答案。希望有人能帮助我清除我的怀疑..

提前致谢

1 个答案:

答案 0 :(得分:4)

您可以使用企业证书分发技术上与您一样多的设备,通过协议存在一些法律限制。

用户可以通过您提供的网站安装该应用。在这个网站上,您可以像这样链接到manifest.plist。使用Archive>时,Xcode可以自动生成manifest.plist。分发>企业

<a href="itms-services://?action=download-manifest&url=https://yourserver/yourpath/manifest.plist">Download and Install</a>

下载并首次启动后,用户还可以转到首选项&gt;一般&gt;个人资料&gt;您的公司名称&gt;接受

这是因为Apple建议您通过企业设备管理进行分发(这是另一个问题和主题)。

要更新应用,您需要检查启动是否有更新的版本,并指向用户新的IPA。

static NSString* plistURL = @"https://yourserver/yourpath/manifest.plist";

@implementation YourAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    [self performSelectorInBackground:@selector(checkForUpdate) withObject:nil];
    return YES;
}

- (void)checkForUpdate;
{   
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:plistURL]];
    NSData *plistData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    if (plistData) {
        NSPropertyListFormat plistFormat;
        NSDictionary *temp = [NSPropertyListSerialization propertyListWithData:plistData options:NSPropertyListImmutable format:&plistFormat error:nil];        
        NSString *onlineVersion = [[temp valueForKeyPath:@"items.metadata.bundle-version"] lastObject];
        NSString *appVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];

        if (! [onlineVersion isEqualToString:appVersion]) {
            dispatch_async(dispatch_get_main_queue(), ^{
                 UIAlertView* dialog = [[UIAlertView alloc] initWithTitle:@"A new version of «Your App» is available" 
                                                             message:@"Would you like to update now? Caution: Since the app is very big, please install it while connected to a Wi-Fi network."                                                                 delegate:self 
                                                   cancelButtonTitle:@"Cancel"
                                                   otherButtonTitles:@"Update...", nil];
                 [dialog show];
            });
        }
    }
}

Apple的文档广泛且好:Distributing Apple Developer Enterprise Program Apps