Skip to content

Commit

Permalink
fix(firebase_messaging): Retrieve messageId from MessagePayload r…
Browse files Browse the repository at this point in the history
…eceived on message event for Web platform. (#7846)
  • Loading branch information
russellwheatley committed Nov 30, 2022
1 parent cba4344 commit d796d33
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class MessagePayload
MessagePayload._fromJsObject(messaging_interop.MessagePayloadJsImpl jsObject)
: super.fromJsObject(jsObject);

String get messageId => jsObject.messageId;
String? get collapseKey => jsObject.collapseKey;
FcmOptions? get fcmOptions => jsObject.fcmOptions == null
? null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ abstract class NotificationPayloadJsImpl {
@JS()
@anonymous
abstract class MessagePayloadJsImpl {
external String get messageId;
external String? get collapseKey;
external FcmOptionsJsImpl? get fcmOptions;
external NotificationPayloadJsImpl? get notification;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Map<String, dynamic> messagePayloadToMap(MessagePayload messagePayload) {
'contentAvailable': null,
'data': data,
'from': messagePayload.from,
'messageId': null,
'messageId': messagePayload.messageId,
'mutableContent': null,
'notification': messagePayload.notification == null
? null
Expand Down

0 comments on commit d796d33

Please sign in to comment.