2020-05-22 22:02:34 +00:00
|
|
|
<?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();
|
2020-06-02 23:21:36 +00:00
|
|
|
$serviceClient->sendCheckEchoRequests( $subscriptions );
|
2020-05-22 22:02:34 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|