laravel-notification-channels / webpush

Webpush notifications channel for Laravel.
http://laravel-notification-channels.com
MIT License
680 stars 119 forks source link

Firefox for Android doesn't deliver every push notifications #103

Open way2datta opened 4 years ago

way2datta commented 4 years ago

Thanks for the library. It is working well for Chrome/Firefox for MAC/Windows. Also, working well with Edge for Windows and Android Chrome.

However, it is giving me a problem when it comes to Android FireFox.

I can subscribe and unsubscribe from Android Firefox. But when a message is sent to the client on Android Firefox below error is thrown:

local.WARNING: Notification failed to sent for subscription 
https://updates.push.services.mozilla.com/wpush/v2/gAAAAABdrtWvpZ_Cb5z45s6s6Sio_y6twMDdwlG4JDYP4qCHfyByM6khVgqmaBODaDTCLAGrN3gQOgUoHfI_Dz8zZ8Lp3_uE-VSvNTZXWD1Ys7_-sUd8prpRpug5tFyorg8TTCpEHuhJG8ygUUsEcQzMM__RadRsHFvdQkdUnrY7vQ6DUbG_zKA: 
Client error: `POST https://updates.push.services.mozilla.com/wpush/v2/gAAAAABdrtWvpZ_Cb5z45s6s6Sio_y6twMDdwlG4JDYP4qCHfyByM6khVgqmaBODaDTCLAGrN3gQOgUoHfI_Dz8zZ8Lp3_uE-VSvNTZXWD1Ys7_-sUd8prpRpug5tFyorg8TTCpEHuhJG8ygUUsEcQzMM__RadRsHFvdQkdUnrY7vQ6DUbG_zKA` 
resulted in a `410 Gone` response:

{"code": 410, "errno": 999, "error": "",
 "more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes",  (truncated...)
atymic commented 4 years ago

Are you still having an issue?

oele-dev commented 4 years ago

I still have this issue

joantp commented 3 years ago

I still have this issue

So do I. Any news, about that?

sebsobseb commented 3 years ago

Same here

nyneplus commented 3 years ago

Dito Could it be related to this

Perhaps some where we can add: $webpush->setAutomaticPadding(2847); $webpush->sendNotification(...)

maciek-szn commented 3 years ago

I don't know if it's related, but I'm getting version 1 of Mozilla webpush service endpoint (so https://updates.push.services.mozilla.com/wpush/v1/...), instead of version 2. And yes, notifications are not delivered, however there are no errors.

gbr161 commented 2 years ago

Hi, im facing this issue too. I've tried to remote debug firefox on my phone to catch errors but there are none, checked laravel logs - same story. Im getting the v1 endpoint in database as @maciek-szn. Notifications work in every other browser except firefox mobile. Anyone knows what the problem is?

goaround commented 2 years ago

I run into the same issue. It's explained here: https://github.com/SherClockHolmes/webpush-go/issues/23#issuecomment-479562884

It's possible to set the automatic Padding to 3052 bytes in WebPush: https://github.com/web-push-libs/web-push-php#how-can-i-disable-or-customize-automatic-padding

It could be added here: https://github.com/laravel-notification-channels/webpush/blob/c8778dff651bb0050a10063ec0a19e597d476338/src/WebPushServiceProvider.php#L33 But I think an option in the config to enable it, would be better.

Another automatic way would be to check if the endpoints is v1: https://updates.push.services.mozilla.com/wpush/v1/... and then set automatic padding to 3052 bytes or if not 4078 bytes here: https://github.com/laravel-notification-channels/webpush/blob/22725422341d92a0e5266a0c94f1d20b0d112c02/src/WebPushChannel.php#L55

imrodrigoalves commented 1 year ago

I think I've something here guys. Maybe you can make use of it too.

Hope it helps.

https://github.com/laravel-notification-channels/webpush/pull/176#issuecomment-1327777681

markusramsak commented 4 months ago

I tested in Firefox on my Android phone and got the following results:

$webPush->setAutomaticPadding(2820); // still works
$webPush->setAutomaticPadding(2821); // doesn't work anymore (413 Payload Too Large)