MobileFirst Foundation - LiveUpdate iOS SDK
### 内容 LiveUpdate iOS SDK 允许您查询在 MobileFirst Operations Console 的 LiveUpdate 设置屏幕中设置的运行时配置属性和功能。将 LiveUpdate 整合到您的应用程序中,您可以实现功能切换、A/B 测试、功能分段等。
### 安装
使用 CocoaPods 安装
use_frameworks!
target 'TestLiveUpdate' do
pod 'IBMMobileFirstPlatformFoundationLiveUpdate'
end
在 MobileFirst Operations Console 中的配置
在您的应用程序中,您必须在安全选项卡下的作用域-元素映射中映射作用域 'liveupdate.mobileclient' 到安全检查,如果您想使用默认的保护,可以映射到空字符串。有关 作用域映射 的更多信息。
有关如何使用 Live Update SDK 的更多信息,请参阅以下 教程。
示例 API 用法
获取配置
LiveUpdateManager.sharedInstance.obtainConfiguration(completionHandler: { (configuration, error) in
if error == nil {
print (configuration?.getProperty("property1"))
print (configuration?.isFeatureEnabled("feature1"))
} else {
print (error)
}
})
禁用缓存(默认缓存启用)
LiveUpdateManager.sharedInstance.obtainConfiguration(useCache: false, completionHandler: { (configuration, error) in
if error == nil {
print (configuration?.getProperty("property1"))
print (configuration?.isFeatureEnabled("feature1"))
} else {
print (error)
}
})
###支持级别
- iOS 8
- iOS 9
- iOS 10
- iOS 11
- iOS 12
- iOS 13
版权 2020 IBM 公司。
遵守 Apache 许可证 2.0 版("许可证");除非适用法律规定或书面同意,否则不得使用此文件,除非符合许可证。您可以在以下位置获取许可证副本:
https://apache.ac.cn/licenses/LICENSE-2.0
除非按照适用的法律要求或书面同意,否则在任何情况下,根据许可证分发软件均按“现状”分发,不提供任何明示或推定的保证或条件。有关许可证的具体语言,请参阅许可证以了解许可权和限制。