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.

To subscribe to these callbacks you have to:

  • Instantiate the InitCallBack object and pass it as the third parameter of the init method.
  • Override the methods that the InitCallBack class implements.
Indigitall.init(context, config, new InitCallBack(context){
   @Override
    public void onIndigitallInitialized(Permission[] permissions, Device device) {}
    @Override
    public void onNewUserRegistered(Device device) {}
    @Override
    public void onErrorInitialized(String error) {}
});

Initialized SDK

The method onIndigitallInitialized of the InitCallBack object will execute 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.

Indigitall.init(context,config, new InitCallBack(context){
   @Override
    public void onIndigitallInitialized(Permission[] permissions, Device device) {
        super.onIndigitallInitialized(permissions, device);
        Log.d("Push Permission: ", permissions[0].toString());
        Log.d("Location Permission: ", permissions[1].toString());
        Log.d("Device: ", device.toString());
    }
});

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(context, config, new InitCallBack(context){
    @Override
    public void onNewUserRegistered(Device device) {
        super.onNewUserRegistered(device);
        Log.d("Device: ", device.toString());
    }
});

An error has occurred

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

It receives the description of the error as a parameter.

Indigitall.init(context, config, new InitCallBack(context) {
    @Override
    public void onErrorInitialized(String error) {
        super.onErrorInitialized(error);
        Log.d("Error on Indigitall.init: ", error);
    }
});