Usage Guide

This document describes how to initialize the SDK, Ticket certificate authentication, and release the SDK library.

Initialize SDK

Apply for SDK Certification
Before using the SDK, you need to create an application on this system to obtain the api secret, app secret and other authorization information. If you do not have an account for the developer platform, you can contact us to obtain it.

Before using the SDK, users need to complete the initialization work of the SDK, import The corresponding header file in AppDelegate.m, and invoke the SDK corresponding method in the following method.

//Set the level of log printing
[[BosmaFramework sharedInstance] setLogLevel:0];
// The data of initialize the SDK
BosmaConfig *config = [[BosmaConfig alloc] init];
config.appID = @"Your AppID";// Set the AppId, provided by BOSMA
config.appSecret = @"Your AppSecret";// Set the AppSecret, provided by BOSMA
config.company = @"Your company name";//The company name, provided by BOSMA

// Initialize the SDK
[[BosmaFramework sharedInstance] initFrameworkWithConfig:config callback:^(int code) {
    if (code == 0) {
        //nitialization succeeded
    }
    else{
        //Initialization failed.
    }
}];

// Registered proxy object of ticket
[[BosmaFramework sharedInstance] registeredCertificationDelegate:self];

Ticket certificate authentication

Implement protocol BosmaCertificationDelegate in the project of AppDelegate.m, and implement its proxy method, in which the user's ticket information is returned to complete the ticket authentication.

@interface AppDelegate ()<BosmaCertificationDelegate>
#pragma mark - BosmaCertificationDelegate
- (NSString *)certificationTicket{
    //When the user logs in, return to Ticket here
    return @"When the user logs in, return to Ticket here";
}

Release SDK Library

// Release SDK
[[BosmaFramework sharedInstance] releaseFramework];

Updated at November 17th, 2022

Was helpful to you?

About this documentation