getInfoFromNotificationWithSendingId static method
void
getInfoFromNotificationWithSendingId(
- Map? authInbox,
- Map param,
- dynamic onSuccess(
- InboxNotification notification
- dynamic onError(
- ErrorModel error
Get info of a notification with SendingId list
param Map with auth config para Map with list of sendingId Callback to get InboxNotification on success Throw ErrorModel if there is some error during the processs
Implementation
static void getInfoFromNotificationWithSendingId(
Map? authInbox,
Map param,
Function(InboxNotification notification)? onSuccess,
Function(ErrorModel error)? onError) async {
param["auth"] = authInbox;
await _indigitall
.invokeMapMethod(_ACTION_GET_INFO_NOTIFICATION, param)
.then((value) => {
if (value != null)
{
value.forEach((key, valueMap) {
if (key == _CALLBACK_GET_INFO_NOTIFICATION) {
if (Platform.isAndroid) {
if (onSuccess != null)
onSuccess(new InboxNotification(valueMap));
} else {
if (onSuccess != null)
onSuccess(new InboxNotification(
json.decode(valueMap.toString())));
}
}
})
}
})
.catchError((error) => {
if (error is PlatformException)
{
if (onError != null)
onError(ErrorModel(error.code, error.message))
}
});
}