-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apns: Use upstream enum for priority
- Loading branch information
1 parent
9e848cb
commit dcd3db4
Showing
9 changed files
with
98 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
/** | ||
* This file contains priority types for Firebase Cloud Messaging Notifications to APNS. | ||
* | ||
* SPDX-FileCopyrightText: Copyright 2024 Move Agency Group B.V., Zwolle, The Netherlands | ||
* SPDX-License-Identifier: MIT | ||
*/ | ||
|
||
namespace Lunr\Vortex\FCM; | ||
|
||
/** | ||
* Firebase Cloud Messaging APNS Priority Types. | ||
*/ | ||
enum FCMApnsPriority: int | ||
{ | ||
|
||
/** | ||
* Prioritize the device’s power considerations over all other factors for delivery, | ||
* and prevent awakening the device | ||
*/ | ||
case Low = 1; | ||
|
||
/** | ||
* Send the notification based on power considerations on the user’s device | ||
*/ | ||
case Default = 5; | ||
|
||
/** | ||
* Send the notification immediately | ||
*/ | ||
case High = 10; | ||
|
||
/** | ||
* Get a case based on the string value. | ||
* | ||
* @param string $value The string representation of the case | ||
* | ||
* @return self|null | ||
*/ | ||
public static function tryFromString(string $value): ?self | ||
{ | ||
return match(strtolower($value)) | ||
{ | ||
'low' => self::Low, | ||
'default' => self::Default, | ||
'high' => self::High, | ||
default => NULL, | ||
}; | ||
} | ||
|
||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters