diff options
-rw-r--r-- | lib/Push.php | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/Push.php b/lib/Push.php index 3fd323f..94f7648 100644 --- a/lib/Push.php +++ b/lib/Push.php @@ -379,11 +379,20 @@ class Push { $client = $this->clientService->newClient(); foreach ($pushNotifications as $proxyServer => $notifications) { try { - $response = $client->post($proxyServer . '/notifications', [ + $requestData = [ 'body' => [ 'notifications' => $notifications, ], - ]); + ]; + + if ($proxyServer === 'https://push-notifications.nextcloud.com') { + $subscriptionKey = $this->config->getAppValue('support', 'subscription_key'); + if ($subscriptionKey) { + $requestData['headers']['X-Nextcloud-Subscription-Key'] = $subscriptionKey; + } + } + + $response = $client->post($proxyServer . '/notifications', $requestData); $status = $response->getStatusCode(); $body = $response->getBody(); $bodyData = json_decode($body, true); |