KahunaControlAppBootup is written in Swift
To run the example project, clone the repo, and run pod install from the Example directory first.
In order to access this feature of app boot up, you need to have Kahuna Logcamp Id
KahunaControlAppBootup is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'KahunaControlAppBootup', '~> 0.1.3'New development will happen exclusively on the master/Swift 3 branch.
let shared = AppBootupHandler.sharedInstance
shared.initServerBaseURL(serverBaseURL: kServerBaseURL)Note: Add import KahunaControlAppBootup into respected file
shared.initAllAppBootupKeys(appId: logCampId)OR
shared.initAllAppBootupKeys(appId: logCampId, checkFreeSpace: true)Note: Default value for checkFreeSpace = false
shared.isAppTypeProduction(flag: true)Note: Default value for production = false
Detect an app to boot or not in a device based on that apply app version, os version and free space.
shared.getAppBootupActionMessage { (success, jsonObject) in
if success && jsonObject is KahunaAppBootup {
let kahunaAppBooup = jsonObject as! KahunaAppBootup
print(kahunaAppBooup.action)
print(kahunaAppBooup.message)
}
}Note: When success == true and jsonObject is KahunaAppBootup then we need to perform check actions and show message
- Action BLOCK -> Restrict User to use an app
- Action WARNING -> Prompt message in an alert to User
- Action REDIRECT_TO_APPSTORE -> Prompt message in an alert to User and click ok then redirect to app store to update an app version
- Action REDIRECT_TO_SETTINGS -> Prompt message in an alert to User and click ok then redirect to device settings to update an os version
KahunaControlAppBootup is available under the MIT license. See the LICENSE file for more info.
