我有一个iOS应用程序,要分发给公司的员工。我知道为此目的,我们需要考虑企业开发人员帐户。我的疑问是我将如何分发构建。苹果是否提供企业商店?如果不是假设我通过 diawi.com 之类的服务分发构建,那么将如何安装更新。当我推出更新时,用户是否应该删除旧版本,然后重新安装它。
我试图在很多地方搜索,但没有得到明确的答案。希望有人能帮我消除疑虑。
提前致谢
您可以使用企业证书分发到技术上任意数量的设备,通过协议存在一些法律限制。
用户将通过您提供的网站安装该应用程序。在这个网站上,你会有一个像这样的manifest.plist的链接。manifest.plist 可以在使用 Archive> Distributed> Enterprise 时由 Xcode 自动生成
<a href="itms-services://?action=download-manifest&url=https://yourserver/yourpath/manifest.plist">Download and Install</a>
下载并首次启动后,用户还将转到首选项>常规>配置文件>您的公司名称>接受
这是因为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 的文档内容广泛且良好:分发 Apple 开发人员企业计划应用程序