Completing the Integration

Callbacks offered by the SDK

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

Initialized SDK

The onIndigitallInitialized method will run when the SDK finishes initializing and the device is ready to receive notifications from indigitall.

Receive as parameter:

  • An array of Permission objects. The first item is the status of the claims permission. The second item is the status of the locate permission.
  • A Device object with the information associated with the device.

Here is an example that prints logs about the status of permissions and device information.

Com.Indigitall.Maui.MIndigitall indigitall = new();
if (indigitall != null)
{
  //android version*****
  indigitall.setContext(this);
  //********
    indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
    {
        Console.WriteLine("device: " + device.deviceId);
        Console.WriteLine("device: " + permissions);
    },(device)=>
    {
        //DO SOMETHING
    },(code, message, description)=>
    {
        //DO SOMETHING
    });

//or also
Com.Indigitall.Maui.MPushConfiguration config = new ();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
indigitall.Init(config, (permissions, device) =>
{
    Console.WriteLine("device: " + device.deviceId);
    Console.WriteLine("device: " + permissions);
}, (device) =>
{
    //DO SOMETHING
}, (errorCode,errorMessage) =>
{
    //DO SOMETHING
});

New registered device

The onNewUserRegistered method 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.

Com.Indigitall.Maui.MIndigitall indigitall = new();
if (indigitall != null)
{
    indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
    {
        //DO SOMETHING
    },(device)=>
    {
        Console.WriteLine("device: " + device.deviceId);
    },(code, message, description)=>
    {
        //DO SOMETHING
    });

An error has occurred

The onErrorInitialized method will be executed only if an error occurs during the initialization of the SDK.

It receives the description of the error as a parameter.

Com.Indigitall.Maui.MIndigitall indigitall = new();
if (indigitall != null)
{
    indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", true, (permissions, device)=>
    {
        //DO SOMETHING
    },(device)=>
    {
        //DO SOMETHING
    },(code, message, description)=>
    {
        Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
    });