iOS
Step by step guide to help you with Leap iOS SDK Integration
- 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
Note: Ensure that you complete both the steps in order to create and test the in-app experience in your integrated build.
Cocoapods
Manually
Swift Package Manager
pod 'LeapSDK', '~> 1.6.0'
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 targethttps://github.com/Leap-Platform/leap-ios
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
import LeapSDK
class AppDelegate:UIResponder, UIApplicaitonDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
Leap.shared.start("<YOUR_API_KEY>")
return true
}
}
#import <LeapSDK/LeapSDK-Swift.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[Leap shared] start:@"<YOUR_API_KEY>"];
return YES;
}
@end
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.
Cocoapods
Manually
Swift Package Manager
pod 'LeapCreatorSDK', '~> 1.6.0'
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 targethttps://github.com/Leap-Platform/leap-creator-ios
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
import LeapCreatorSDK
class AppDelegate:UIResponder, UIApplicaitonDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
LeapCreator.shared.start("<YOUR_API_KEY>")
return true
}
}
#import <LeapCreatorSDK/LeapCreatorSDK-Swift.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[LeapCreator shared] start:@"<YOUR_API_KEY>"];
return YES;
}
@end
Last modified 2mo ago