mediawiki-extensions-Echo/includes/Push/NotificationRequestJob.php

24 lines
555 B
PHP
Raw Normal View History

<?php
namespace EchoPush;
use EchoServices;
use Job;
class NotificationRequestJob extends Job {
/**
* @return bool success
*/
public function run(): bool {
$centralId = $this->params['centralId'];
$echoServices = EchoServices::getInstance();
$subscriptionManager = $echoServices->getPushSubscriptionManager();
$subscriptions = $subscriptionManager->getSubscriptionsForUser( $centralId );
$serviceClient = $echoServices->getPushNotificationServiceClient();
$serviceClient->sendCheckEchoRequest( $subscriptions );
return true;
}
}