The KPP SDKs provide developers with the building blocks to start building on top of the Monetate platform. These SDKs provide standardized functions that abstract low-level Engine API calls to help you save time and effort in development. Refer to Calling the Engine API for information on making Engine API requests.
This documentation guides you through setting up and implementing the SDK.
You must have CocoaPods installed to set up this SDK. Refer to the installation instructions for CocoaPods for more information.
Installing and Importing Packages
Initialize the CocoaPod for your project, then add
pod 'monetate-ios-sdk' to your project Podfile.
Then open a Terminal to your project location by dragging your project folder into the Terminal and run the following command:
To install the SDK, run the following commands in an Xcode terminal:
pod 'monetate-ios-sdk' pod 'monetate-ios-sdk', :git => 'https://github.com/monetate/kibo-ios-sdk-cocoapod.git', :branch => 'main'
When prompted, use the credentials provided to you by Support.
After installation, the SDK shows up in the Pods directory in your project sidebar.
To import the SDK into a project, include the following code:
import SDK import "monetate-ios-sdk"
To initialize an object to communicate with the Engine API, add the following initialization code:
Initialize Personalization.setup( account: Account(instance: "p", domain: "localhost.org", name: "a-701b337c", shortname: "localhost"), user: User(kiboId: "auto"), contextMap: setupContextMap() )
Then include this code with appropriate values substituted for
contextMap to create a new instance:
let sdkInstace = Personalization(account, user, contextMap)
For a complete list of methods and objects that you can use, refer to SDK API Reference and the iOS SDK Readme.