File tree 2 files changed +7
-2
lines changed 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ public function jsonSerialize()
174
174
if ($ this ->contentAvailable ) {
175
175
$ jsonData ['content_available ' ] = $ this ->contentAvailable ;
176
176
}
177
- if ($ this ->notification ) {
177
+ if ($ this ->notification && $ this -> notification -> hasNotificationData () ) {
178
178
$ jsonData ['notification ' ] = $ this ->notification ;
179
179
}
180
180
Original file line number Diff line number Diff line change @@ -77,9 +77,14 @@ public function setTag($tag)
77
77
return $ this ;
78
78
}
79
79
80
+ public function hasNotificationData ()
81
+ {
82
+ return $ this ->title || $ this ->body || $ this ->badge || $ this ->icon || $ this ->clickAction || $ this ->sound || $ this ->tag ;
83
+ }
84
+
80
85
public function jsonSerialize ()
81
86
{
82
- $ jsonData = $ this -> getJsonData () ;
87
+ $ jsonData = [] ;
83
88
if ($ this ->title ) {
84
89
$ jsonData ['title ' ] = $ this ->title ;
85
90
}
You can’t perform that action at this time.
0 commit comments