Push.Delivery service wrapper which makes it possible to send Push Notifications via various channels to many subscribers and in high speed
The easiest and recommended way to install this utility is as a composer package:
composer require ethinking/push-api dev-masterAdd to your root routes.yaml the next code:
push_api_service_worker:
path: /service-worker.js
controller: Ethinking\EthinkingPushApiBundle\Controller\ServiceWorkerController::indexAction
push_api_web_push:
path: /webpush.js
controller: Ethinking\EthinkingPushApiBundle\Controller\WebPushController::indexActionAdd to your services.yaml the next code:
Ethinking\EthinkingPushApiBundle\Service\PushApiService:
arguments:
- '@Symfony\Contracts\HttpClient\HttpClientInterface'
- '@logger'
- '@Symfony\Contracts\Cache\CacheInterface'Initialize in your class:
use Ethinking\EthinkingPushApiBundle\Service\PushApiService;
use Ethinking\EthinkingPushApiBundle\Entity\Settings;
public function __construct(PushApiService $pushApiService)
{
settings = new Settings(
$this->getSettingsId(),
$this->getDomain(),
$this->getUsername(),
$this->getPassword(),
$this->getClientId()
);
$pushApiService->setSettings($settings);
}Update assets
yarn encore devClear cache
php bin/console c:c