iOS Quickstart
1. Install the SDK
The iOS SDK is a dynamic framework, compatible with iOS 9.0 and higher, Xcode 10+. Will work with Swift 4.2, along with Objective-C.
Integrating with CocoaPods
Simply add the SDK to your Podfile
:
pod 'LMGUI'
Then run pod install
to have CocoaPods add the framework to your project.
If you don't have a Podfile
or are unsure on how to proceed, see the CocoaPods usage guide.
2. Initialization
Create an Integration Write Key
Create a new Integration for your app in the Property you're working with, and use the Integration Write Key to initialize the SDK (below).
See Enabling SDK Integrations for more details.
Initialize SDK
Using the Integration Key, initialize the SDK client in your AppDelegate application:didFinishLaunchingWithOptions:
method:
@import LMGUI;
...
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
... your app init code ...
[[LMGClient shared] setIntegrationKey:@"MY_INTEGRATION_KEY"];
return YES;
}
3. Additional configuration
To ensure smooth operation of the SDK please enable Background fetch in your build Target's Capabilities
. Alternatively, you can add following section to your app's Info.plist
configuration file:
<key>UIBackgroundModes</key>
<array>
<string>fetch</string>
</array>
4.Testing your integration
Run app. You should see following message in your log:
Finished use case: LMGStartSession
with params: <your_key>
result: <LMGSession: 0x600002e20780>
error: (null)
5. Anonymous usage
Some SDK features requires the session to be autenticated, to do that you'll need to conform the protocol LMGClientAuthenticationDelegate
and implement the method (void)userAuthenticationRequiredByClient: