File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ public function jsonSerialize()
174174 if ($ this ->contentAvailable ) {
175175 $ jsonData ['content_available ' ] = $ this ->contentAvailable ;
176176 }
177- if ($ this ->notification ) {
177+ if ($ this ->notification && $ this -> notification -> hasNotificationData () ) {
178178 $ jsonData ['notification ' ] = $ this ->notification ;
179179 }
180180
Original file line number Diff line number Diff line change @@ -77,9 +77,14 @@ public function setTag($tag)
7777 return $ this ;
7878 }
7979
80+ public function hasNotificationData ()
81+ {
82+ return $ this ->title || $ this ->body || $ this ->badge || $ this ->icon || $ this ->clickAction || $ this ->sound || $ this ->tag ;
83+ }
84+
8085 public function jsonSerialize ()
8186 {
82- $ jsonData = $ this -> getJsonData () ;
87+ $ jsonData = [] ;
8388 if ($ this ->title ) {
8489 $ jsonData ['title ' ] = $ this ->title ;
8590 }
You can’t perform that action at this time.
0 commit comments