- Layout custom
If for some reason you don't want to show the push as the native android sample, we leave this option to show the push with our custom layout . To do this add the following code in the init call:
indigitall.Init("YOUR APPKEY", "YOUR SENDER ID", requestLocation: true, wifiFilterEnabled: true, customBasic: "custom")
//or also
Com.Indigitall.Xamarin.Models.IConfiguration config = new Com.Indigitall.Xamarin.Models.IConfiguration();
config.appKey = "<YOUR-APP-KEY>";
config.senderId = "<YOUR-SENDER-ID>";
config.logDebug = false;
config.layoutBasic = Com.Indigitall.Xamarin.Models.Layoutbasic.Custom;
indigitall.Init(config);
Remember that as of android 10, the custom layout will cause problems in displaying images if the mobile has dark mode activated. If the custom layout is not indicated, it will be displayed in native mode
Manage device
This section describes the different actions that could be performed on an indigitall device
Check device information and status
You can use the deviceGet method to get the information that the SDK has recorded regarding the device.
The callback will receive as a parameter the device object that contains all the information associated with the device.
indigitall.DeviceGet((device) =>
{
if (device != null)
{
Console.WriteLine("Device: " + device.deviceId);
}
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
Enable / disable device
You can choose to disable the device to block the receipt of notifications. It is a very useful method to:
- Implement a preferences screen so that the user can enable / disable the receipt of notifications.
- Avoid receiving notifications if the user has not logged in, or has not accepted the terms of use, etc.
- Manage the Robinson List .
To do this, you have the deviceEnable and deviceDisable methods.
The callback will receive as a parameter the device object that contains all the information associated with the device.
indigitall.DeviceEnable((device)=>{
Console.WriteLine("Device: " + device.deviceId);
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});
indigitall.DeviceDisable((device)=>{
Console.WriteLine("Device: " + device.deviceId);
},(errorCode,errorMessage)=>
{
Console.WriteLine("ErrorCode: " + errorCode+" Message: "+ errorMessage);
});