SMAUpdatesAvailable 1.0.3

SMAUpdatesAvailable 1.0.3

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年5月

Bill Burgess 维护。



  • Bill Burgess

这个库是一种简单易用的方式来检查您的iOS App Store上的应用是否有更新可用的。

版本 1.0

这是这个库的第一个版本,包含调用Apple的查找服务并返回您应用的当前数据的所有基本功能。这意味着您的应用必须在App Store中批准且处于活动状态才能正常工作。在每一步都内置了应急措施,如果发生任何变化或没有正确返回,则返回NO以表示没有可用的更新。这样,您应该可以放心地将检查设置为不需要意外提示用户更新。

版本控制

该库假设您正在使用语义版本控制为您的应用设置版本。这意味着您的版本设置为以下格式。

MAJOR.MINOR.PATCH

为了让这个库工作,您的版本必须是 NSString(由于Apple要求必须是这种方式,所以很容易设置)并且您的项用句点分隔。假设您正在使用这种版本控制方式,该库将为您正常工作。

版本类型

您可以在检查更新中指定您希望查找有多精确。也许您只关心在发布主要或次要更新时提示用户,但不想为错误修复而烦扰他们。

SMAVersionTypeMajor // only prompts for update if major version changes
SMAVersionTypeMajorMinor // only prompts for update if major or minor version changes
SMAVersionTypeMajorMinorBug // only prompts for update if major, minor, or bug version changes
SMAVersionTypeDefault // will prompt for update at any level of update

示例

[SMAUpdatesAvailable checkForUpdatesWithType:SMAVersionTypeMajorMinorBug onCompletion:^(SMAUpdateResponse *response) {
    if (response.updateAvailable) {
        // safe to prompt user to update your app
    } else {
        // no updates available 
    }
}];

SMAUpdateResponse 对象包含用于检查更新的所有数据。如果您愿意,可以查询响应并自行解析数据。

response.appVersion // current version of your app as reported by MainBundle
response.appStoreVersion // current version of your app as reported by Apple's lookup service (if returned)
response.updateAvailable // BOOL to quickly determine if update is available for your app
response.rawData // NSDictionary of the full response returned by Apple's lookup service (has a lot of Store information)
response.error // error returned in the event of failures at any point and can be helpful for user messages if needed

安装

  • #import "SMAUpdatesAvailable.h" 放在想要检查更新的位置
  • pod install SMAUpdatesAvailable
  • 将源文件复制到您的项目中。只需 SMAUpdatesAvailableSMAUpdateResponse 即可

要求

SMAUpdatesAvailable 需要[iOS 8.0]或更高版本。我们将努力使它在经过适当的测试后能够提供到尽可能多的版本。

  • iOS 8.0或更高版本
  • tvOS 9.0 或更高版本

鸣谢

SMAUpdatesAvailable 是为使用 Simply Made Apps 创建的项目编写的,这样我们可以帮助用户更新到我们应用程序的最新版本。

制作人

Bill Burgess @billburgess

许可证

SMAUpdatesAvailable 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。

下一步是什么

  • 测试其在旧版 iOS 上的工作情况,以便我们可以安全地添加旧版 iOS。
  • 添加对 Mac App Store 更新的支持。
  • 原生/更好的 Swift 支持。现在已有大部分实现,但 Swift 分支会避免桥接头。
  • 用于模拟我的网络调用和从主 bundle 获取数据测试的模拟库。
  • 我们欢迎对该库的任何 pull requests 或建议。