iOS
Step by step guide to help you with Leap iOS SDK Integration

This guide will help you set up Leap platform for iOS devices. You can follow the steps below to integrate Leap SDK before using your dashboard to create in-app experiences.

Prerequisites

  • You will need the API key.
  • Leap SDK's minimum deployment target is iOS 10. But Leap works only for devices running on iOS 11 and above
  • Leap currently doesn't support iPads; works only in iPhones.
  • To identify views accurately, you are required to tag views. Here is how you can do it.
  • Xcode

SDK Installation

Note: Ensure that you complete both the steps in order to create and test the in-app experience in your integrated build.

Step 1. Integrate Leap SDK

1.a. Add LeapSDK as a library from dependency managers suitable to your project

Cocoapods
Manually
Swift Package Manager
1
pod 'LeapSDK', '~> 1.1.8'
Copied!
Add the above line in your Podfile and do pod install
Download the frameworks from
Add both of these frameworks to your app target's Frameworks, Libraries And Embedded Content. You will also need to add https://github.com/1024jp/GzipSwift.git as a swift package to the app target
1
https://github.com/Leap-Platform/leap-ios
Copied!
1.b. Start Leap SDK
Call the following method to start the Leap SDK. (Preferably in the application(_:didFinishLaunchingWithOptions:) method in AppDelegate class).
Swift
Objective-C
1
import LeapSDK
2
3
class AppDelegate:UIResponder, UIApplicaitonDelegate {
4
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
5
Leap.shared.start("YOUR_API_KEY")
6
return true
7
}
8
}
Copied!
1
#import <LeapSDK/LeapSDK-Swift.h>
2
3
@implementation AppDelegate
4
5
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
6
7
[[Leap shared] start:@"YOUR_API_KEY"];
8
return YES;
9
}
10
11
@end
Copied!

Step 2. Enable 'Creator mode' in your app

To create in-app experiences in the Leap Studio, you will need to enable the Creator mode in your app. This can be done by integrating the Leap Creator SDK.
The Leap Creator SDK must be removed before you make the build live on Appstore.

2.a. Add LeapCreatorSDK as a library from dependency managers suitable to your project

Cocoapods
Manually
Swift Package Manager
1
pod 'LeapCreatorSDK', '~> 1.1.8'
Copied!
Add the above line in your Podfile and do pod install
Download the framework from https://github.com/Leap-Platform/leap-creator-ios.git. Add the framework to your app target's Frameworks, Libraries And Embedded Content. You will also need to add https://github.com/daltoniam/Starscream.git as a swift package to the app target
1
https://github.com/Leap-Platform/leap-creator-ios
Copied!
2.b. Start Leap Creator SDK
Call the following method to start the Leap SDK. (Preferably in the application(_:didFinishLaunchingWithOptions:) method in AppDelegate class).
Swift
Objective-C
1
import LeapCreatorSDK
2
3
4
class AppDelegate:UIResponder, UIApplicaitonDelegate {
5
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
6
LeapCreator.shared.start("YOUR_API_KEY")
7
return true
8
}
9
}
Copied!
1
#import <LeapCreatorSDK/LeapCreatorSDK-Swift.h>
2
3
@implementation AppDelegate
4
5
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
6
7
[[LeapCreator shared] start:@"<YOUR_API_KEY>"];
8
return YES;
9
}
10
11
@end
Copied!
Setup Leap Callbacks: Click here.
Setup Segmentation Support: Click here.