Need help with the integration?

Type a word or a phrase to start browsing through articles.

[BlinkID] Using .key instead of the .mblic file

Follow

Even though the license key file has changed the format from .mblic to .key with the Developer Hub, the implementation process stays the same.

 

Obtaining the license key file

  1.  Go to your Developer Hub account: https://developer.microblink.com/
  2. In the Licenses section, you will see a list of all of the generated license keys
  3. After clicking on the license key you wish to use, click on the Download key option

Implementing the license key file into your project

iOS

  1. Copy the downloaded license.key into your project folder
  2. Open your Xcode project and drag the license.key file into your project
  3. Go to TARGETS and Build Phases
  4. Click on the Copy Bundle Resources and tap on the "+" symbol
  5. In the pop-up menu, add the license.key file
  6. Go back to your code
  7. In the place you're initializing the SDK (for instance, in the viewDidLoad()), add the following line:
    MBMicroblinkSDK.shared().setLicenseResource("license", withExtension: "key", inSubdirectory: "", for: .main) { _ in
                //block for handling licence key exceptions
    }
    NOTE: You can change the name of the license.key file, but then you need to enter the license's name in the first parameter of the setLicenseResource method (here, the key's name is "license")

Android

  1. Download your license file and put it in your application's assets folder.
  2. Extend the Android Application class and set the license in onCreate callback like this:
public final class BlinkIdSampleApp extends Application {

@Override
public void onCreate() {
super.onCreate();

// obtain your licence at http://microblink.com/login or contact us at http://help.microblink.com
MicroblinkSDK.setLicenseFile("license.key", this);

// use optimised way for transferring RecognizerBundle between activities, while ensuring
// data does not get lost when Android restarts the scanning activity
MicroblinkSDK.setIntentDataTransferMode(IntentDataTransferMode.PERSISTED_OPTIMISED);
}

}
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments