-
Bug
-
Resolution: Fixed
-
Minor
-
4.0.0-a1
-
None
Firefox on Android gets an error from push notifications like:
Web Push message could not be sent: Client error: `POST https://updates.push.services.mozilla.com/wpush/v2/gAAAAABmXAUOb6I8fz_AqiU8n7iDJJNvnFuCZ6fxSvoUh2GKhKW6lHFK1disqH8Q6HC7CGUFCcnjF2InWst1MJFbnxmAQHgm8-c4SNTslMpa4XDg5X4gOQeqlLgQiJaLYx1d4E1LzSKReAwIgDc3DDllND2t09ppMVWTcuUXsnx4_J8d_M9YfrM` resulted in a `413 Payload Too Large` response: {"code":413,"errno":104,"error":"Payload Too Large","message":"This message is intended for a constrained device and is (truncated...)
|
Additional info: https://github.com/web-push-libs/web-push-php/issues/108
Suggested fix is to limit the encryption payload for this browser/device.
In the notification/webpush class, after:
$web_push = new \Minishlink\WebPush\WebPush($auth); |
add something like (2820 seems to be the max number FF/Android will handle):
// Fix encryption payload size for Firefox on Android
|
if (preg_match('/android.*firefox/i', $this->user->browser)) |
{
|
$web_push->setAutomaticPadding(2820); |
}
|