Callbacks offered by the SDK
Our SDK offers various callbacks that help you have greater control of the execution flow and implement custom behaviors.
IndigitallFlutterPlugin.init({
IndigitallParams.PARAM_APP_KEY: "YOUR_APPKEY",
IndigitallParams.PARAM_SENDER_ID: "YOUR_SENDER_ID",
IndigitallParams.PARAM_REQUEST_LOCATION: true
}, (device)=> {
//LOG device onIndigitallInitialized
}, (device) => {
//LOG device onNewUserRegistered
}, (error) => {
//LOG IndigitallErrorModel
});
Initialized SDK
The onIndigitallInitialized callback will be executed 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.
IndigitallFlutterPlugin.init(
{
IndigitallParams.PARAM_APP_KEY: "YOUR_APPKEY",
IndigitallParams.PARAM_SENDER_ID: "YOUR_SENDER_ID",
IndigitallParams.PARAM_REQUEST_LOCATION: true
}, (device)=> {
print("Device: " + device.toString());
}, null, null);
New registered device
The onNewUserRegistered 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.
It receives as a parameter the Device object with the information associated with the device.
IndigitallFlutterPlugin.init({
IndigitallParams.PARAM_APP_KEY: "YOUR_APPKEY",
IndigitallParams.PARAM_SENDER_ID: "YOUR_SENDER_ID",
IndigitallParams.PARAM_REQUEST_LOCATION: true
}, null, (device)=> {
print("Device: " + device.toString());
}, null);
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.
IndigitallFlutterPlugin.init({
IndigitallParams.PARAM_APP_KEY: "YOUR_APPKEY",
IndigitallParams.PARAM_SENDER_ID: "YOUR_SENDER_ID",
IndigitallParams.PARAM_REQUEST_LOCATION: true
}, (device)=> {
//LOG device
}, (errorModel) => {
print("Error: "+ errorModel.errorMessage);
});