constructFCMPayload method

String constructFCMPayload(
  1. String? msg,
  2. String? token
)

Implementation

String constructFCMPayload(String? msg, String? token) {
  return jsonEncode({
    "message": {
      "token": token,
      "notification": {"title": "FCM Message", "body": msg}
    }
  });
}