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:
Indigitall.init(
  { 
    appKey: "YOUR_APPKEY", 
    senderId: "YOUR_SENDER_ID", 
    autoRequestPushPermission: false,
    requestLocation: true 
  }, (device)=> {
   //LOG device
 }, (errorMessage)=>{
   //LOG ERROR
 });

[...]

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

[...]
 
 /* to request push permission */
Indigitall.requestPushPermission();

On Android you have to override the permission request result method to permit to the sdk to treat the permission result on android 13 or above. Add it on MainActivity:

public class MainActivity extends BridgeActivity {

  @Override
  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    IndigitallCp.onRequestPermissionsResult(this, requestCode, permissions, grantResults);
  }
  • alwaysLaunchOnInit: on the first time initializing on Android, callback onIndigitallInitialized is executed. Default value is false.
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.

Indigitall.init(
  { 
    appKey: "YOUR_APPKEY",
    senderId: "YOUR_SENDER_ID",
    requestLocation: true 
  }, (device, pushPermission, locationPermission)=> {
            //LOG device
  }, (error)=>{
            //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, pushPermission, locationPermission)=> {
        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, pushPermission, locationPermission)=> {
      //LOG device
  }, (error)=>{
      console.log("Error: ", error.errorMessage;
  });