Add The IOS Framework To Your ProjectΒΆ

The first step in adding LaunchKey to your iOS service is to download the NativeSDK.framework. Drag the NativeSDK.framework bundle to the Frameworks group of your project. When prompted, select Copy items into destination group's folder.

../../../../_images/framework-adding.png

You should now see NativeSDK.framework under your Frameworks group.

../../../../_images/framework-directory.png

Next, add the Security.framework dependency to your project:

  1. Select your project from the Project Navigator and choose your service's target.
  2. Open the Build Phases tab and add Security.framework to the Link Binary with Libraries section.
../../../../_images/security-adding.png

Next, create a URL types in the Info.plist file of your project.

  1. Right click and select Add Row and select URL types as the key for the new row.
  2. Click the arrow next to URL types, expand the row and then right click and add another row under URL types, then select URL Scheme* as the key for this row.
  1. Click the arrow next to URL Schemes to expand the row and enter LK followed by your 10 digit app_key (found in the app details section of your Dashboard) in the value field. (e.g. LK1234567890)
../../../../_images/url-types.png

Finally, the Manager needs to be aware of the authentication response returned from the app via the URL scheme that you just set up. To do this, instantiate the URL callback function (openURL) in your AppDelegate:

-(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [[AuthenticationManager sharedClient] handleOpenUrl:url];
}

In the openUrl function body call:

return [[AuthenticationManager sharedClient] handleOpenUrl:url];

This will allow the Manager to properly handle the callback.

User Contributed

LaunchKey links to user contributed code as a resource to its community. LaunchKey does not in any way guarantee or warrant the quality and security of these code bases. User contributed code is supported by the creators. If you do find a link from the site to user contributed code that is malicious or inappropriate in any way, please report that link to LaunchKey immediately and we will investigate the claim. Submit any issue to LaunchKey support at https://launchkey.com./support. ×