Usage Guide

This document describes how to initialize the SDK and Ticket certificate authentication

SDK Initialize

We recommend initializing SDK in Application

private void initSDK() {

    //Initialize Framework
    BosmaFramework.getInstance().init(this);
    // Log console print: false by default , call after  BosmaFramework.getInstance().init(this);
    BosmaFramework.getInstance().enableLog(true);
    // release server
    BosmaFramework.getInstance().setServerEnv(UrlConfig.NET_ENV_REL);
   
    //initialize ble
    BleHelper.init(this, true);

    // Error handle
    RxJavaPlugins.setErrorHandler(throwable -> {
    ViseLog.e(throwable.getMessage());
    });

   }

Ticket Certificate Authentication

The ticket will be get from Bosma server.

Execute ticket authentication in the following way, and only after successful authentication can you use the SDK interface

 BosmaFramework.getInstance().initializeFrameWorkWithCertification(new BSCertificationInterface() {

            @Override
            public String getCertificationTicket() {
                return TICKET; //ticket
            }

            @Override
            public void onSuccess() {
                BosmaHttp.getInstance().initWithToken(BosmaFramework.getInstance().getTicket());
            }

            @Override
            public void onFailed() {
                ViseLog.e("Ticket initialize failed");
            }
        });

Updated at November 17th, 2022

Was helpful to you?

About this documentation