getMessageStatus function

String getMessageStatus(
  1. dynamic status
)

Determines the message status based on the provided status value.

Implementation

String getMessageStatus(dynamic status) {
  if (Platform.isAndroid) {
    return status;
  } else {
    switch (status) {
      case 2:
        return "A"; //acknowledge
      case 3:
        return "D"; //delivered
      case 4:
        return "S"; //seen
      case 5:
        return "R"; //received
      default:
        return "N"; //"N" for "notAcknowledged" in iOS,
    }
  }
}