From 8f8ff2588bfeec2db68fb02cc4b853b19e171998 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 29 Jan 2020 13:16:18 +0100 Subject: [PATCH] Support Strict VoIP push notifications for iOS 13 SDK Signed-off-by: Joas Schilling --- lib/Push.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/Push.php b/lib/Push.php index 810a00399..441746f8c 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -274,8 +274,10 @@ protected function encryptAndSign(Key $userKey, array $device, int $id, INotific if ($isTalkNotification) { $priority = 'high'; + $type = $data['type'] === 'call' ? 'voip' : 'alert'; } else { $priority = 'normal'; + $type = 'alert'; } if (!openssl_public_encrypt(json_encode($data), $encryptedSubject, $device['devicepublickey'], OPENSSL_PKCS1_PADDING)) { @@ -293,6 +295,7 @@ protected function encryptAndSign(Key $userKey, array $device, int $id, INotific 'subject' => $base64EncryptedSubject, 'signature' => $base64Signature, 'priority' => $priority, + 'type' => $type, ]; } @@ -334,6 +337,7 @@ protected function encryptAndSignDelete(Key $userKey, array $device, int $id): a 'subject' => $base64EncryptedSubject, 'signature' => $base64Signature, 'priority' => 'normal', + 'type' => 'background', ]; }