Skip to content

Commit c39097f

Browse files
authored
Merge pull request #45 from macr1408/master
Fix bug where notifications are not being received in Android
2 parents 2579fea + f2a8095 commit c39097f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/ExpoMessage.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)