Skip to content

Commit edeb1e0

Browse files
[Change]: Allow developers to change the notification priority parameter as Expo documentation
1 parent 081ee44 commit edeb1e0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/ExpoMessage.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ class ExpoMessage
5656
*/
5757
protected $jsonData = '{}';
5858

59+
/**
60+
* The priority of notification message for Android devices.
61+
*
62+
* @var string
63+
*/
64+
protected $priority = 'default';
65+
5966
/**
6067
* Create a message with given body.
6168
*
@@ -198,6 +205,20 @@ public function setJsonData($data)
198205
return $this;
199206
}
200207

208+
/**
209+
* Set the priority of the notification for Android devices, must be one of [default, normal, high].
210+
*
211+
* @param string $priority
212+
*
213+
* @return $this
214+
*/
215+
public function setPriority(string $priority)
216+
{
217+
$this->priority = $priority;
218+
219+
return $this;
220+
}
221+
201222
/**
202223
* Get an array representation of the message.
203224
*
@@ -212,6 +233,7 @@ public function toArray()
212233
'badge' => $this->badge,
213234
'ttl' => $this->ttl,
214235
'data' => $this->jsonData,
236+
'priority' => $this->priority,
215237
];
216238
if (! empty($this->channelId)) {
217239
$message['channelId'] = $this->channelId;

0 commit comments

Comments
 (0)