Closed JRaspass closed 5 years ago
@JRaspass running into the same issues and I was actually going to write up an issue about this last night. Seems like the issue is with the maxRecordLength
and the pad
function. The maxRecordLength
in webpush-go
is hard coded to 4096 and we pad every message to that length for security reasons, but for Firefox Mobile the max content length is 3070.
There's a PHP library for webpush that had similar issues and allows for a custom max content size to be passed in. @SherClockHolmes would you be okay with that solution?
PHP lib issue: https://github.com/web-push-libs/web-push-php/issues/62
PHP lib documentation of max content sizeL: https://github.com/web-push-libs/web-push-php#how-can-i-disable-or-customize-automatic-padding
P.S. It's been a while, but hope all is well @SherClockHolmes. This lib is great BTW
@JRaspass @andrewtet Thanks for digging into the issue for me. I should have time for implementing this over the weekend.
For some reason RecordSize: 3070
didn't work for me with firefox android. I got a response back saying: "Final composed message payload too long for recipient: 4170 bytes. Please try a shorter message."
No idea why that was larger than the limit set
RecordSize: 2048
seems to have worked
Firstly, great work on this library, its working wonderfully for Chrome (Android/Desktop) and Firefox (Desktop), but I'm getting the following error when sending to Firefox on Android: