Completing the Integration

Configurable properties of SDK initialize

  • AutoRequestPushPermission: to request permission automatically or manually. Default value is true. But if you want to do manually, you have to add these methods
window.plugins.indigitall.init(
  { 
    appKey: "YOUR_APPKEY", 
    senderId: "YOUR_SENDER_ID", 
    autoRequestPushPermission: false,
    requestLocation: true 
  }, (device)=> {
   //LOG device
 }, (errorMessage)=>{
   //LOG ERROR
 });

[...]

/* To get status push permission*/
window.plugins.indigitall.getPushPermissionStatus(status => {
 /* STATUS: granted/notDeterminated/denied */
 	console.log("status getPushPermissionStatus: ", status);
}, (error) => {
  console.log("ERROR getPushPermissionStatus: ", error);
});

[...]
 
 /* to request push permission */
 window.plugins.indigitall.requestPushPermission();

  • alwaysLaunchOnInit: on the first time initializing on Android, callback onIndigitallInitialized is executed. Default value is false.
window.plugins.indigitall.init(
  { 
    appKey: "YOUR_APPKEY", 
    senderId: "YOUR_SENDER_ID", 
    alwaysLaunchOnInit: false,
    requestLocation: true 
  }, (device)=> {
   //LOG device
 }, (errorMessage)=>{
   //LOG ERROR
 });

Callbacks offered by the SDK

Our SDK offers various callbacks that help you have greater control of the execution flow and implement custom behaviors.

window.plugins.indigitall.init(
  { 
    appKey: "YOUR_APPKEY", 
    senderId: "YOUR_SENDER_ID", 
    requestLocation: true 
  }, (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.

window.plugins.indigitall.init(
  { 
    appKey: "YOUR_APPKEY",
    senderId: "YOUR_SENDER_ID", 
    requestLocation: true 
  }, (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.

window.plugins.indigitall.init(
  {
    appKey: "YOUR_APPKEY",
    senderId: "YOUR_SENDER_ID",
    requestLocation: true
  }, (device)=> {
        //LOG device
  }, (errorMessage)=>{
       console.log("Error: ", errorMessage;
  });