How to integrate the SDK

Manually

  1. Drag and drop GSSDK.framework and optionally GSSDKScannerUI.framework and GSSDKOCR.framework into your project.
  2. Add them to the ‘Embedded binaries’ section of the General tab
  3. Before submitting to the App Store you will need to remove the x86_64 and i386 slices of the SDK; iTunes will reject any binary containing non-ARM code slices. To let you run the Genius Scan SDK on the simulator, we provide it as fat frameworks containing the x86_64 and i386 slices. You need to strip them out with a script like this one before submitting to the App Store. Make sure that you add this build phase after the Embed Framework phase of your project.

With CocoaPods

If you already use CocoaPods, you can use the Genius Scan SDK as a Pod. Just add the following line to your existing Podfile (Make sure you specify the correct SDK location)

pod 'GSSDK', :podspec => 'https://s3.amazonaws.com/tgl.geniusscan.sdk/GSSDK-VERSIONPLACEHOLDER.podspec'

The SDK is modular, so you can also include only the desired subspec: Core, OCR or ScannerUI.

Configuring your project

Since the project uses some C++ code, you also need to link with the standard C++ library. In the project’s Build Phases, add libstdc++ in Link Binary With Libraries.

Include the Genius Scan SDK header wherever you want to use it:

#import <GSSDK/GSSDK.h>

Build your project.

You will find all the API documentation in the headers of the SDK.

Configuring a license key

The SDK can run without a license key but will stop working after 60 seconds.

You will need to initialize the SDK with your license key using the following command:

NSError *error = nil;
if (![GSK initWithLicenseKey:@"<YOUR LICENSE KEY>" error:&error]) {
    NSLog(@"Error while initializing the Genius Scan SDK: %@", error);
}

This method will return a boolean indicating whether the license key has been accepted and is still valid. If the license key has expired, a good practice is to show a message to your users, asking them to update the app.

Note about the sample apps: if you have a license key, you can use it for the sample apps, but make sure you change the bundle ID of the sample app to match the bundle ID associated with your license key.