Skip to content

Commit a72e689

Browse files
committed
fix(firebase_push_notification_client): correct notification payload mapping
- Replace payload.body with payload.title in notification body - Reconstruct data payload from explicit fields instead of using payload.data directly - Update data payload structure to include specific notification details
1 parent 5260c71 commit a72e689

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/src/services/firebase_push_notification_client.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,16 @@ class FirebasePushNotificationClient implements IPushNotificationClient {
115115
'token': token,
116116
'notification': {
117117
'title': payload.title,
118-
'body': payload.body,
118+
'body': payload.title,
119119
if (payload.imageUrl != null) 'image': payload.imageUrl,
120120
},
121-
'data': payload.data,
121+
// Reconstruct the data payload from the explicit fields
122+
'data': {
123+
'notificationId': payload.notificationId,
124+
'notificationType': payload.notificationType.name,
125+
'contentType': payload.contentType.name,
126+
'contentId': payload.contentId,
127+
},
122128
},
123129
};
124130

0 commit comments

Comments
 (0)