public function pushNotificationAsync(PushNotification $notification, PushSubscription $subscription, int $ttl = 3600) : PromiseInterface
    {
        $cipher = $this->cryptograph->encrypt($notification, $subscription);

        $pushMessage = new Message($cipher, $subscription, $ttl);

        $request = $this->pushService->createRequest($pushMessage, $subscription);
        $promise = $this->httpClient->sendAsync($request);

        return $promise;
    }
public function pushNotificationAsync(PushNotification $notification, PushSubscription $subscription, int $ttl = 3600) : PromiseInterface
    {
        $cipher = $this->cryptograph->encrypt($notification, $subscription);

        $pushMessage = new Message($cipher, $subscription, $ttl);

        $request = $this->pushService->createRequest($pushMessage, $subscription);
        $promise = $this->httpClient->sendAsync($request);

        return $promise;
    }
public function pushNotificationAsync ( PushNotification $ notification , PushSubscription $ subscription , int $ ttl = 3600 ) : PromiseInterface { $ cipher = $ this -> cryptograph -> encrypt ( $ notification , $ subscription ) ; $ pushMessage = new Message ( $ cipher , $ subscription , $ ttl ) ; $ request = $ this -> pushService -> createRequest ( $ pushMessage , $ subscription ) ; $ promise = $ this -> httpClient -> sendAsync ( $ request ) ; return $ promise ; }
Send a push notification asynchronously.

@param PushNotification $notification
@param PushSubscription $subscription
@param int $ttl

@return PromiseInterface
Send a push notification asynchronously .