diff --git a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java index fc2ba9db3624..64f1ff40602b 100644 --- a/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java +++ b/android/app/src/main/java/com/expensify/chat/customairshipextender/CustomNotificationProvider.java @@ -224,7 +224,7 @@ private void applyMessageStyle(@NonNull Context context, NotificationCompat.Buil // Use the formatted alert message from the backend. Otherwise fallback on the message in the Onyx data. String message = alert != null ? alert : messageData.get("message").getList().get(0).getMap().get("text").getString(); - String roomName = payload.get("roomName") == null ? "" : payload.get("roomName").getString(""); + String subtitle = payload.get("subtitle") == null ? "" : payload.get("subtitle").getString(""); // Create the Person object who sent the latest report comment Bitmap personIcon = fetchIcon(context, avatar); @@ -257,11 +257,11 @@ private void applyMessageStyle(@NonNull Context context, NotificationCompat.Buil } // Conversational styling should be applied to groups chats, rooms, and any 1:1 chats with more than one notification (ensuring the large profile image is always shown) - if (!roomName.isEmpty()) { + if (!subtitle.isEmpty()) { // Create the messaging style notification builder for this notification, associating it with the person who sent the report comment messagingStyle .setGroupConversation(true) - .setConversationTitle(roomName); + .setConversationTitle(subtitle); } builder.setStyle(messagingStyle); builder.setShortcutId(accountID); diff --git a/ios/NotificationServiceExtension/NotificationService.swift b/ios/NotificationServiceExtension/NotificationService.swift index db999e0ec631..37da5acf8350 100644 --- a/ios/NotificationServiceExtension/NotificationService.swift +++ b/ios/NotificationServiceExtension/NotificationService.swift @@ -180,7 +180,7 @@ class NotificationService: UANotificationServiceExtension { userName: userName, title: notificationContent.title, messageText: notificationContent.body, - roomName: payload["roomName"] as? String + subtitle: payload["subtitle"] as? String ) } @@ -199,8 +199,8 @@ class NotificationService: UANotificationServiceExtension { // Configure the group/room name if there is one var speakableGroupName: INSpeakableString? = nil var recipients: [INPerson]? = nil - if (notificationData.roomName != nil) { - speakableGroupName = INSpeakableString(spokenPhrase: notificationData.roomName ?? "") + if (notificationData.subtitle != nil) { + speakableGroupName = INSpeakableString(spokenPhrase: notificationData.subtitle ?? "") // To add the group name subtitle there must be multiple recipients set. However, we do not have // data on the participatns in the room/group chat so we just add a placeholder here. This shouldn't @@ -262,9 +262,9 @@ class NotificationData { public var userName: String public var title: String public var messageText: String - public var roomName: String? + public var subtitle: String? - public init (reportID: Int64, reportActionID: String, avatarURL: String, accountID: Int, userName: String, title: String, messageText: String, roomName: String?) { + public init (reportID: Int64, reportActionID: String, avatarURL: String, accountID: Int, userName: String, title: String, messageText: String, subtitle: String?) { self.reportID = reportID self.reportActionID = reportActionID self.avatarURL = avatarURL @@ -272,6 +272,6 @@ class NotificationData { self.userName = userName self.title = title self.messageText = messageText - self.roomName = roomName + self.subtitle = subtitle } } diff --git a/src/libs/Notification/PushNotification/NotificationType.ts b/src/libs/Notification/PushNotification/NotificationType.ts index 6e450d7eacc1..d209d970a53c 100644 --- a/src/libs/Notification/PushNotification/NotificationType.ts +++ b/src/libs/Notification/PushNotification/NotificationType.ts @@ -19,6 +19,7 @@ type PushNotificationData = ReportActionPushNotificationData | TransactionPushNo type BasePushNotificationData = { title: string; + subtitle: string; type: ValueOf; onyxData?: OnyxServerUpdate[]; lastUpdateID?: number; @@ -29,13 +30,11 @@ type BasePushNotificationData = { type ReportActionPushNotificationData = BasePushNotificationData & { reportID: number; reportActionID: string; - roomName?: string; }; type TransactionPushNotificationData = BasePushNotificationData & { - transactionID: number; reportID: number; - roomName?: string; + transactionID: number; }; /**