Skip to content

Commit 25466da

Browse files
committed
fix(firebase_messaging): make notification body optional
- Updated FirebaseNotification model to make the body field optional - Fixed a bug in FirebasePushNotificationClient where the notification body was incorrectly set to the payload title
1 parent 67d2496 commit 25466da

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

lib/src/models/push_notification/firebase_request_body.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ class FirebaseNotification extends Equatable {
7474
/// {@macro firebase_notification}
7575
const FirebaseNotification({
7676
required this.title,
77-
required this.body,
77+
this.body,
7878
this.image,
7979
});
8080

8181
/// The notification's title.
8282
final String title;
8383

8484
/// The notification's body text.
85-
final String body;
85+
final String? body;
8686

8787
/// The URL of an image to be displayed in the notification.
8888
final String? image;

lib/src/services/firebase_push_notification_client.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ class FirebasePushNotificationClient implements IPushNotificationClient {
116116
token: token,
117117
notification: FirebaseNotification(
118118
title: payload.title,
119-
body: payload.title,
120119
image: payload.imageUrl,
121120
),
122121
data: payload,

0 commit comments

Comments
 (0)