Install the iOS SDK

This documentation guides you through setting up and implementing the iOS SDK.

Prerequisites

You must have CocoaPods installed to set up this SDK. Refer to CocoaPods Getting Started for more information.

Installing the iOS SDK

Complete the following steps to integrate the SDK within your app:

  1. Open the PodFile and add the following code:
    target 'monetate' do
      # Commend the next line if you do not want to use dynamic frameworks
      use_frameworks!
      pod 'monetate-ios-sdk'
      # Pods for monetate
      post_install do |installer|
        installer.generated_projects.each do |project|
    	  project.targets.each do |target|
    	    target.build_configurations.each do |config|
    		  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    		end
    	  end
    	end
      end
    end
  2. Go to the root path of your project in the terminal and run pod install.

After installation, the SDK shows up in the Pods directory in your project sidebar.

The location of the SDK in the project directory.

Getting Started

To initialize an object to communicate with the Engine API, use the following code:

Personalization.setup(account: Account(instance: "p", domain: "localhost.org", name: "a-701b337c", shortname: "localhost"), user: User(monetateId: "auto"))