diff options
author | Mario Danic <mario@lovelyhq.com> | 2018-06-22 19:25:48 +0300 |
---|---|---|
committer | Mario Danic <mario@lovelyhq.com> | 2018-07-11 11:22:57 +0300 |
commit | 8804c3d30cd9a2f034a51e0f3076fc373d77bebe (patch) | |
tree | ea9f5d3a5b50f940c8106603be6c72c347f8e328 | |
parent | df3a338afb915615fb7bd20e61a88d07a507d880 (diff) |
Add prioritization for Talk
Signed-off-by: Mario Danic <mario@lovelyhq.com>
-rw-r--r-- | lib/Push.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Push.php b/lib/Push.php index 1213d7f..f03349e 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -190,6 +190,12 @@ class Push { 'id' => $notification->getObjectId(), ]; + if ($isTalkNotification) { + $priority = "high"; + } else { + $priority = "normal"; + } + if (!openssl_public_encrypt(json_encode($data), $encryptedSubject, $device['devicepublickey'], OPENSSL_PKCS1_PADDING)) { $this->log->error(openssl_error_string(), ['app' => 'notifications']); throw new \InvalidArgumentException('Failed to encrypt message for device'); @@ -204,6 +210,7 @@ class Push { 'pushTokenHash' => $device['pushtokenhash'], 'subject' => $base64EncryptedSubject, 'signature' => $base64Signature, + 'priority' => $priority, ]; } |