Cheetah CES Docs Portal

Navigation
Home
GitHub
Email
Corporate Site

IOS SDK
Introduction
Getting Started
At a Glance: Using the Cheetah Loyalty Kits
Using Sample Application
UI Customization
iOS Kit Reference
Swift SDK Reference

Getting Started

The Cheetah Loyalty Digital Kits for iOS is built with dependency management in mind. Cocoapods is therefore a requirement for developers to be able to incorporate the kits into their projects and build loyalty applications in no time.

Setting up Cheetah Loyalty Access

Before creating an app running on top of the Cheetah Loyalty Platform, make sure you have a valid login to the Cheetah Marketing Console.

Then, navigate to the Applications screen in the Cheetah Marketing Console to get your Member API OAuth Client ID and Client Secret.

Requirements

  • Deployment Target: iOS 11.0
  • Xcode 11.x
  • Swift 5.1

Installation

Cocoapods

  1. Open a terminal window then add the private podspec repo to the Cocoapods installation by entering the following:
     pod repo add CheetahLoyaltySDK https://github.com/LoyalSphere/cheetah-loyalty-ios-sdk-podspecs.git
    
  2. Add a source for the CheetahLoyaltySDK then add the Cheetah Digital Kits pod in your podfile:

     platform :ios, '11.0'
    	
     source 'https://github.com/LoyalSphere/cheetah-loyalty-ios-sdk-podspecs.git'
     source 'https://github.com/CocoaPods/Specs.git'
    	
     target '<YourApp>' do
       # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
       use_frameworks!
    	
       pod 'CheetahDigitalCore'
       pod 'CheetahDigitalUI'
       pod 'CheetahDigitalChallenges'
       pod 'CheetahDigitalPlaces'
       pod 'CheetahDigitalRewards'
       pod 'CheetahDigitalNotifications'
     end
    
  3. Open a terminal window to where your project and podfile is located and run the following to install the pod:
     pod install
    

Manually

  1. Download the CheetahDigitalCore SDK from the releases.
  2. Extract it then drag & drop <CheetahDigitalKit>.xcframework to your project’s directory.
  3. In “Frameworks, Libraries, and Embedded Content” section under the “General” tab, click on the “+” button then “Add Other”, and then “Add Files…”.
  4. Select the <CheetahDigitalKit>.xcframework file and make sure that it is set to “Embed & Sign” in the “Embed” column in the “Frameworks, Libraries, and Embedded Content” section under the “General” tab.

Configuration

Before using the Cheetah Digital Kits, a configuration file is needed to determine the settings it needs upon sending requests. The configuration file is a plist named CheetahDigital-Info. The file is to be included in the project bundle.

The primary contents of this CheetahDigital-Info.plist are as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>BUSINESS_UNIT</key>
	<string>SwiftSDKBusinessUnit</string>
	<key>USER_AGENT_NAME</key>
	<string>SwiftSDK</string>
	<key>CLIENT_ID</key>
	<string><your_client_id></string>
	<key>CLIENT_SECRET</key>
	<string><your_client_secret></string>
	<key>CLIENT_URL</key>
	<string><your_client_url></string>
	<key>METRIC</key>
	<string><your_metric></string>
	<key>GEOFENCING_ENABLED</key>
	<true/>
	<key>ACCESS_TOKEN_EXTERNAL</key>
	<false/>
	<key>APP_LANGUAGE</key>
	<string><your_app_language></string>
</dict>
</plist>

The keys used in the CheetahDigital-Info.plist are:

  • BUSINESS_UNIT - String indicating the business unit.
  • USER_AGENT_NAME - The user agent name to be used in the header of requests.
  • CLIENT_ID - The API KEY for the Loyalty API
  • CLIENT_SECRET - The API SECRET KEY for the Loyalty API
  • CLIENT_URL - The URL of the Loyalty API gateway
  • METRIC - The API metric
  • GEOFENCING_ENABLED - Boolean flag that indicates whether geofencing is enabled
  • ACCESS_TOKEN_EXTERNAL - Boolean flag that indicates whether the access token is from an external source
  • APP_LANGUAGE - String indicating the app language

Some of these values can be found in the console of the environment the app is going to use.

After completing the steps outlined above, you are now ready to make an app using the Cheetah Digital Kits!

Next: At a Glance: Cheetah Loyalty Kits