Skip to content
On this page

License

The Binah.ai SDK uses a licensing mechanism to protect against unauthorized usage, and to grant measurement permissions specified in Binah's license agreement.

License Types

Binah offers the license types:

  1. Active Users
  2. Sessions

Using the License Key

A valid license key must be provided in order to initiate a measurement session or activate a user.

Swift
do {
    let licenseDetails = LicenseDetails(licenseKey: "<ENTER_YOUR_LICENSE_KEY>") 
    let session = try FaceSessionBuilder()  
        .withImageListener(self)
        .withVitalSignsListener(self)
        .withSessionInfoListener(self)
        .build(licenseDetails: licenseDetails)  
}
catch {
    let e = error as NSError
    print("Received Error. Domain: \(e.domain) Code: \(e.code)")
}
Objective-c
BNHLicenseDetails *licenseDetails = [[BNHLicenseDetails alloc] initWithLicenseKey:@"<ENTER_YOUR_LICENSE_KEY>"];
BNHFaceSessionBuilder *sessionBuilder = [[[[[BNHFaceSessionBuilder alloc] init] 
                                           withImageListener:self]
                                          withVitalSignsListener:self]
                                         withSessionInfoListener:self];


NSError *error = nil;
id<BNHSession> _Nullable session = [sessionBuilder buildWithLicenseDetails:licenseDetails
                                                                     error:&error]; 
if (error != nil) {
    NSLog(@"Received Error. Domain: %@ Code: %ld", error.domain, (long)error.code);
}

WARNING

The application must secure the license key and prevent it from being exposed to 3rd parties.

Receiving License Updates

The SDK sends a LicenseInfo object that contains:

The application can receive license-related messages by implementing onLicenseInfo as part of SessionInfoListener:

Swift
func onSessionStateChange(sessionState: SessionState) {
    // Receive session state updates
}

func onWarning(warningData: WarningData) {
    // Receive warnings
}

func onError(errorData: ErrorData) {
    // Receive errors
}

func onLicenseInfo(licenseInfo: LicenseInfo) { 
    // Receive license info 
}

func onEnabledVitalSigns(enabledVitalSigns: SessionEnabledVitalSigns) {
    // Receive the enabled vital signs for the session
}
Objective-C
- (void)onSessionStateChangeWithSessionState:(BNHSessionState *)sessionState {
    // Receive session state updates
}

- (void)onWarningWithData:(BNHWarningData *)warningData {
    // Receive warnings
}

- (void)onErrorWithData:(BNHErrorData *)errorData {
    // Receive errors
}

- (void)onLicenseInfoWithInfo:(BNHLicenseInfo *)licenseInfo { 
    // Receive license info
}

- (void)onEnabledVitalSignsWithEnabledVitalSigns:(BNHEnabledVitalSigns *)enabledVitalSigns {
    // Receive the enabled vital signs for the session
}