Skip to content

feat(firebase_messaging): Adds the action identifier #17324

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,11 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
// coming from a terminated state.
if (_notificationOpenedAppID != nil &&
![_initialNotificationID isEqualToString:_notificationOpenedAppID]) {
NSDictionary *notificationDict =
[FLTFirebaseMessagingPlugin remoteMessageUserInfoToDict:remoteNotification];
NSMutableDictionary *notificationDict =
[[FLTFirebaseMessagingPlugin remoteMessageUserInfoToDict:remoteNotification] mutableCopy];
if (response.actionIdentifier != nil) {
notificationDict[@"actionIdentifier"] = response.actionIdentifier;
}
[_channel invokeMethod:@"Messaging#onMessageOpenedApp" arguments:notificationDict];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RemoteMessage {
const RemoteMessage(
{this.senderId,
this.category,
this.actionIdentifier,
this.collapseKey,
this.contentAvailable = false,
this.data = const <String, dynamic>{},
Expand All @@ -28,6 +29,7 @@ class RemoteMessage {
return RemoteMessage(
senderId: map['senderId'],
category: map['category'],
actionIdentifier: map['actionIdentifier'],
collapseKey: map['collapseKey'],
contentAvailable: map['contentAvailable'] ?? false,
data: map['data'] == null
Expand Down Expand Up @@ -77,6 +79,9 @@ class RemoteMessage {
/// The iOS category this notification is assigned to.
final String? category;

/// The iOS action identifier for the category
final String? actionIdentifier;

/// The collapse key a message was sent with. Used to override existing messages with the same key.
final String? collapseKey;

Expand Down
Loading