File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ class ExpoMessage
4747 *
4848 * @var string
4949 */
50- protected $ channelId = 'Default ' ;
50+ protected $ channelId = '' ;
5151
5252 /**
5353 * The json data attached to the message.
@@ -205,14 +205,18 @@ public function setJsonData($data)
205205 */
206206 public function toArray ()
207207 {
208- return [
208+ $ message = [
209209 'title ' => $ this ->title ,
210210 'body ' => $ this ->body ,
211211 'sound ' => $ this ->sound ,
212212 'badge ' => $ this ->badge ,
213213 'ttl ' => $ this ->ttl ,
214- 'channelId ' => $ this ->channelId ,
215- 'data ' => $ this ->jsonData ,
214+ 'data ' => $ this ->jsonData ,
216215 ];
216+ if (! empty ($ this ->channelId )) {
217+ $ message ['channelId ' ] = $ this ->channelId ;
218+ }
219+
220+ return $ message ;
217221 }
218222}
You can’t perform that action at this time.
0 commit comments