Add Kettle
Preqrequisites
The following criterias must be fulfilled to implement the SDK:
- Minimum iOS target: 11.0
Install Kettle
Swift Package Manager (SPM)
- In Xcode, go to File > Add Package Dependencies...
- Enter the package repository URL:
https://github.com/fluxloop/spm-kettle-kit.git - Select the latest version
- Add the package to your target
Alternatively, add it to your Package.swift file:
Package.swift
dependencies: [
.package(url: "https://github.com/fluxloop/spm-kettle-kit.git", from: "x.x.x")
]
CocoaPods
Add the following pod to your podfile:
Podfile
pod 'KettleKit', 'x.x.x'
Background modes
Add the following background modes to your application:
- bluetooth-central
- location
Initialize Kettle
AppDelegate.swift
import KettleKit
...
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
...
let kettleConfig = KettleConfig.default()
kettleConfig.developmentApiKey = "<DEVELOPMENT-API-KEY>"
kettleConfig.productionApiKey = "<PRODUCTION-API-KEY>"
Kettle.prepare(config, launchOptions: launchOptions)
...
}