Zealot iOS SDK
The iOS component provides a service to check for new versions and installations for Zealot, supporting Swift and Objective-C.
Install​
Cocoapods​
Adding below code into Podfile
:
pod 'Zealot', :git => 'https://github.com/tryzealot/zealot-ios.git', :branch => 'master'
Install it:
pod install
Usages​
Import header​
- Add the code in your
AppDelegate
:
- Swift
- Objective-C
import Zealot
// Objective-C
#import <Zealot/Zealot-Swift.h>
Configure​
- Add the following code in
application:didFinishLaunchingWithOptions:
method block:
- Swift
- Objective-C
// Single channel
let zealot = Zealot(endpoint: "https://zealot.example.com", channelKey: "...")
zealot.checkVersion()
// Multi-channel, such as beta, adhoc versions
let zealot = Zealot(endpoint: "https://zealot.example.com",
channelKeys: [
"beta": "xxxxxxx",
"test": "yyyyyyy"],
default_enviroment: "beta")
// Active it
zealot.checkVersion()
// Single channel
Zealot *zealot = [[Zealot alloc] initWithEndpoint:@"https://zealot.example.com"
channelKey:@"..."];
// Multi-channel, such as beta, adhoc versions
Zealot *zealot = [[Zealot alloc] initWithEndpoint:@"https://zealot.example.com"
channelKeys:@{
@"beta": @"xxxxxxx",
@"gray": @"yyyyyyy"
}
default_enviroment:@"beta"];
// Active it
[zealot checkVersion];