Callbacks offered by the SDK
Our SDK offers various callbacks that help you have greater control of the execution flow and implement custom behaviors.
Indigitall.init({
appKey: "YOUR_APPKEY",
senderId: "YOUR_SENDER_ID",
requestLocation: true
}, (device)=> {
//LOG device
}, (device)=> {
//LOG device
}, (errorMessage)=>{
//LOG ERROR
});
Initialized SDK
The device object that returns the callback will be executed when the device has been registered for the first time, that is, in the first execution of the app after being installed. and when the SDK finishes initializing and the device is ready to receive notifications from indigitall.
It receives as a parameter the Device object with the information associated with the device.
Indigitall.init({
appKey: "YOUR_APPKEY",
senderId: "YOUR_SENDER_ID",
requestLocation: true
}, (device)=> {
console.log("Device: ", Object.values(device));
});
New registered device
The method onNewUserRegistered of the InitCallBack object will be executed when the device has been registered for the first time, that is, in the first execution of the app after being installed.
It receives as a parameter the Device object with the information associated with the device.
Indigitall.init({
appKey: "YOUR_APPKEY",
senderId: "YOUR_SENDER_ID",
requestLocation: true
}, (device)=> {
// log device init
}, (device)=> {
console.log("Device: ", Object.values(device));<--
});
An error has occurred
The error method will run only if an error occurs during the initialization of the SDK.
It receives the description of the error as a parameter.
Indigitall.init({
appKey: "YOUR_APPKEY",
senderId: "YOUR_SENDER_ID",
requestLocation: true
}, (device)=> {
//LOG device
}, (device)=> {
//LOG device
}, (errorMessage)=>{
console.log("Error: ", errorMessage;
});