Skip to main content

Add Kettle

Preqrequisites

The following criterias must be fulfilled to implement the SDK:

  • Minimum iOS target: 11.0

Install Kettle

Swift Package Manager (SPM)

  1. In Xcode, go to File > Add Package Dependencies...
  2. Enter the package repository URL:
    https://github.com/fluxloop/spm-kettle-kit.git
  3. Select the latest version
  4. 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)
...
}