In order to start using any of our SDK methods, the first thing you need to do is to initialize our SDK.
To initialize it, after adding the SDK dependency to your Android app, execute the following method:
Configuration config = new Configuration.Builder("YOUR_APPKEY","YOUR_SENDER_ID")
.setLogDebug(LogLevel.DEBUG)
.setPushServiceDisabled(true) // Use this if your app does not use push notifications
.build();
Indigitall.init(context, config, new InitCallBack(context) {
@Override
public void onIndigitallInitialized(Permission[] permissions, Device device) {
// SDK initialized
}
@Override
public void onErrorInitialized(int errorId, String errorMessage, String descriptionMessage) {
// Handle initialization errors
}
});val config = Configuration.Builder("YOUR_APPKEY", "YOUR_SENDER_ID")
.setLogDebug(LogLevel.DEBUG)
.setPushServiceDisabled(true) // Use this if your app does not use push notifications
.build()
Indigitall.init(context, config, object : InitCallBack(context) {
// Override the callbacks you need
})Once the customer is linked, the customer's id can be requested as follows:
Indigitall.getCustomer(this, object : CustomerCallback(this) {
override fun onSuccess(customer: Customer) {
// Use the customer data
}
override fun onError(errorModel: ErrorModel?) {
// Handle the error
}
})Indigitall.getCustomer(this, new CustomerCallback(this) {
@Override
public void onSuccess(Customer customer) {
// Use the customer data
}
@Override
public void onError(ErrorModel errorModel) {
// Handle the error
}
});And the customer's information about its fields as follows:
Indigitall.getCustomerInformation(context, arrayListOf(), object: CustomerFieldCallback(context){
override fun onSuccess(customerField: ArrayList<CustomerField>) {
//do something
}
override fun onError(errorModel: ErrorModel?) {
//log error
}
})Indigitall.getCustomerInformation(this, new ArrayList<>(), new CustomerFieldCallback(this) {
@Override
public void onSuccess(ArrayList<CustomerField> fields) {
// Use the customer fields
}
@Override
public void onError(ErrorModel errorModel) {
// Handle the error
}
});