getInfoFromNotificationWithSendingId static method

void getInfoFromNotificationWithSendingId(
  1. Map? authInbox,
  2. Map param,
  3. dynamic onSuccess(
    1. InboxNotification notification
    )?,
  4. dynamic onError(
    1. 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))
              }
          });
}