indigitall SDK for inbox clicking here
User Identification
In order to get the notifications from Indigitall's Inbox, the user must identify himself. First you have to initialize the SDK of Indigitall so that it generates our identifier (deviceId) and be able to associate it with the custom ID that you associate to the device.
To perform the registration tasks, these two methods are used:
//User ID
Indigitall.logIn(this, "YOUR_EXTERNAL_ID", new DeviceCallback(context) {
@Override
public void onSuccess(Device device) {
//DO SOMETHING
}
@Override
public void onFail(ErrorModel errorModel) {
//LOG ERROR
}
});
//Disconnection
Indigitall.logOut(this, new DeviceCallback(context) {
@Override
public void onSuccess(Device device) {
//DO SOMETHING
}
@Override
public void onFail(ErrorModel errorModel) {
//LOG ERROR
}
});Indigitall.logIn(this, "YOUR_EXTERNAL_ID", object : DeviceCallback(this) {
override fun onSuccess(device: Device?) {
// User identified
}
override fun onFail(errorModel: ErrorModel?) {
// Handle the error
}
})
Indigitall.logOut(this, object : DeviceCallback(this) {
override fun onSuccess(device: Device?) {
// User disconnected
}
override fun onFail(errorModel: ErrorModel?) {
// Handle the error
}
})Generate authentication token
In this section you will see how to generate a validation token for an application that has configured authentication with webhook. To generate this token, you need to add the JSON with the configuration.
The token has a predetermined expiration date, once it has expired in our system, a listener event of type InboxAuthListener will be fired indicating said expiration and will have to return the configuration JSON. To collect the listener, you have to implement it in the corresponding class, and override the following method:
public class MyInboxAuthListener implements InboxAuthListener {
private final JSONObject myJson = new JSONObject();
@Override
public JSONObject getAuthConfig() {
return myJson;
}
}class MyInboxAuthListener : InboxAuthListener {
private val myJson = JSONObject()
override fun getAuthConfig(): JSONObject = myJson
}