I am unable to send notifications with payloads.
Each time the payload is not empty, the request is sent and sendNotification method returns true (when I dumped response, status code was 201), but no notification is delivered.
$webPush = $this->get('minishlink_web_push');
$notifications = [
[
'subscription' => Subscription::create([
'endpoint' => 'https://fcm.googleapis.com/fcm/send/chvo9gq76WU:APA91bHh661rEeUWR14F9VTyghQTu1qNAQOGFEH0rbwWSsKRjxR9NP2hzyoryMOYLNHBgGnEnCeOuPwXOtTd2uSd8Ks8lWeLyzzXvNWWBj-H1DzN5rQGgsij7lv-2sZWPu6kZJ9dlUZm', // Firefox 43+,
'publicKey' => 'publicKey', // base 64 encoded, should be 88 chars
'authToken' => 'authToken', // base 64 encoded, should be 24 chars
]),
'payload' => 'hello !',
]
];
foreach ($notifications as $notification) {
$webPush->sendNotification(
$notification['subscription'],
$notification['payload']
);
}
$webPush->flush();
I am unable to send notifications with payloads. Each time the payload is not empty, the request is sent and sendNotification method returns true (when I dumped response, status code was 201), but no notification is delivered.