Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Enums/PriorityEnum.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace NotificationChannels\ExpoPushNotifications\Enums;

enum PriorityEnum: string
{
case Default = 'default';
case High = 'high';
case Normal = 'normal';
}
7 changes: 4 additions & 3 deletions src/ExpoMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace NotificationChannels\ExpoPushNotifications;

use NotificationChannels\ExpoPushNotifications\Enums\InterruptionLevelEnum;
use NotificationChannels\ExpoPushNotifications\Enums\PriorityEnum;
use NotificationChannels\ExpoPushNotifications\Exceptions\CouldNotCreateMessage;

class ExpoMessage
Expand All @@ -20,7 +21,7 @@ public function __construct(
protected int $ttl = 0,
protected string $channelId = '',
protected string $jsonData = '{}',
protected string $priority = 'default',
protected PriorityEnum $priority = PriorityEnum::Default,
protected ?InterruptionLevelEnum $interruptionLevel = null,
) {
}
Expand Down Expand Up @@ -98,7 +99,7 @@ public function setJsonData(array|string $data): self
return $this;
}

public function priority(string $priority): self
public function priority(PriorityEnum $priority): self
{
$this->priority = $priority;

Expand All @@ -114,7 +115,7 @@ public function toArray(): array
'badge' => $this->badge,
'ttl' => $this->ttl,
'data' => $this->jsonData,
'priority' => $this->priority,
'priority' => $this->priority->value,
];

if (!empty($this->channelId)) {
Expand Down