MobbSign Cordova: Initialization
Initialization
First of all, the plugin will not be available until the Cordova deviceready
event triggers. It is strongly recommended to initialize MobbSign Cordova plugin as follows:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
// Here goes MobbSignAPI initialization code.
}
If you are using Ionic and Angular, Platform.ready()
method could be used:
import { Platform } from '@ionic/angular';
class SomeComponent {
constructor(private platform: Platform) {
this.platform.ready().then(() => {
// Here goes MobbSignAPI initialization code.
});
}
}
In both cases, the first steps that should be performed are the definition of Mobbsign API URL and the initialization of the API using a provided license code:
MobbSignAPI.initMobbSignWithLicense(inputLicenseId.value, success, failure);
MobbSignAPI.setSignDocumentInterface(interfaceName, success, failure);
In both methods, success
and failure
are callbacks that will be called in case of success or failure respectively.
Once the success
callback of MobbSignAPI.initMobbSignWithLicense
is called, MobbSignAPI
is ready for use.