# Migrate from PinchSDK v2 to Kettle v1

This page describes how to migrate your application from using PinchSDK v2 to Kettle.

# Before you begin

This guide assumes that you fullfill the requirements to implement PinchSDK. iOS target has been increased from 9.0 to 11.0 due to versions below 11.0 being marked obsolete by Apple.

Requirements:

# iOS

# Step 1: Replace existing reference to pod

In your app's Podfile, remove the following pods:

PinchSDK
PinchSDKLegacy
PinchSDKLegacyBluetooth
1
2
3

Add the following pod:

pod 'KettleKit', '1.0.0'
1

# Step 2: Replace imports

Replace all instances of:

import PinchSDK
1

with

/// swift
import KettleKit

/// objc
#import <KettleKit/KettleKit-Swift.h>
1
2
3
4
5

# Step 3: Replace API calls

# PinchSDK.initialize(with: launchOptions, apiKey: "")

let config = KettleConfig.default()
config.productionApiKey = "PRODUCTION-API-KEY"
config.developmentApiKey = "DEVELOPMENT-API-KEY"

Kettle.prepare(config, launchOptions: launchOptions)
1
2
3
4
5

Additionally, config has the following fields and method available:

inProduction: Production status for the application. This value is used by Kettle to determine if the application is in production. If this value is not set, Kettle will set this value based on the application build scheme.

developmentLogLevel: Log level used for development apps.

productionLogLevel: Log level used for production apps.

validate(): Used to validate the config.

# Consents

# PinchSDK.grant(consents: [.ads, .analytics, ...]) { success in ... }

# PinchSDK.revoke(consents: [.ads, .analytics, ...]) { success in ... }

# PinchSDK.grantedConsents

# PinchSDK.adid

This method is obsolete and removed.

# PinchSDK.start(providers: [.bluetooth, .location, .motion])

# PinchSDK.stop(providers: [.bluetooth, .location, .motion])

# PinchSDK.isTracking { sdkStarted in ... }

# PinchSDK.messagingId

This method was used to either retrieve the internal identifier assigned by Pinch or set an external identifier or send push tokens. This method is now obsolete and has been replaced by three variables, responsible for each part.

# PinchSDK.sendDemographicProfile(with: DemographicProfile) { success in ... }

Currently no migration path.

# PinchSDK.setMetadata(type: type, json: json) { success in ... }

Currently no migration path.

# PinchSDK.addCustomData(type: type, json: json) { success in ... }

Currently no migration path.

# PinchSDK.privacyTermsUrl

# PinchSDK.getPrivacyDashboardUrl(for: .analytics)

# PinchSDK.deleteCollectedData() { success in ... }

# PinchSDK.requestBluetoothPermission()

# PinchSDK.getGender(for: name) { gender in ... }

Currently no migration path.