mirror of
https://github.com/friendica/friendica
synced 2025-04-27 23:10:12 +00:00
Adding the VAPID keys
This commit is contained in:
parent
d5e9253adb
commit
69f11c4a84
3 changed files with 37 additions and 5 deletions
|
@ -23,6 +23,8 @@ namespace Friendica\Worker;
|
|||
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Subscription as ModelSubscription;
|
||||
use Minishlink\WebPush\WebPush;
|
||||
use Minishlink\WebPush\Subscription;
|
||||
|
||||
|
@ -41,7 +43,15 @@ class PushSubscription
|
|||
'payload' => null,
|
||||
];
|
||||
|
||||
$webPush = new WebPush();
|
||||
$auth = [
|
||||
'VAPID' => [
|
||||
'subject' => DI::baseUrl()->getHostname(),
|
||||
'publicKey' => ModelSubscription::getPublicVapidKey(),
|
||||
'privateKey' => ModelSubscription::getPrivateVapidKey(),
|
||||
],
|
||||
];
|
||||
|
||||
$webPush = new WebPush($auth);
|
||||
|
||||
$report = $webPush->sendOneNotification(
|
||||
$notification['subscription'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue