开源库
https://github.com/nicklockwood/iVersion
添加Configurations

添加 宏定义

编写自动更新代码
编辑AppDelegate.m
#pragma mark - iVersion
#ifdef GITHUB
+ (void)initialize
{
//configure iVersion. These paths are optional - if you don't set
//them, iVersion will just get the release notes from iTunes directly (if your app is on the store)
[iVersion sharedInstance].remoteVersionsPlistURL = @"https://gpxj.github.io/versions.plist";
[iVersion sharedInstance].localVersionsPlistPath = @"versions.plist";
NSString *updateUrl = @"itms-services:///?action=download-manifest&url=https://gpxj.github.io/gpxj.plist";
[iVersion sharedInstance].updateURL = [NSURL URLWithString:updateUrl];
}
#endif
添加 version.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>0.1.0</key>
<array>
<string>First Version.</string>
</array>
</dict>
</plist>
本文介绍了一种在iOS应用中实现自动更新的方法。通过使用nicklockwood开发的开源库iVersion,文章详细展示了如何配置自动更新流程,包括添加必要的宏定义、编辑AppDelegate.m文件以及创建版本信息文件version.plist。

被折叠的 条评论
为什么被折叠?



