Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox on Android not working #62

Closed
degtyaryov opened this issue Nov 23, 2016 · 5 comments
Closed

Firefox on Android not working #62

degtyaryov opened this issue Nov 23, 2016 · 5 comments

Comments

@degtyaryov
Copy link

Hello.

web-push-php not working for Firefox on Android. For Firefox on Desktop all working.

example without vapid:

$webPush = new Minishlink\WebPush\WebPush();
$result = $webPush->sendNotification(
    'https://updates.push.services.mozilla.com/wpush/v1/gAAAAABYNX0F_-z03mY2cPTxDhnaTtloaaCR8Uf1HDvuyxso14jo3fJVd7GUDjqyMwThrmKHsQJYhb3WyGN-OMpxPcdcl68stMzDVUbiiuWsQfFRPwyCl4u1p6IhQ1JD2wDi0rQJc8Lu',
    '{"title":"title","body":"body","icon":"/favicon.ico","uri":"\/"}',
    'BCwyI3k8mhF/6xSqMhjolS+HxUFRDf6xNhm4+2wwCMAHwjCyAHkv1uq3kAQKi5y3DoJMUEYfMr3L6VQiElmaI6k=',
    'y22TWVKVHGRz6AFp0ybBdA==',
    true
);

result without vapid:

array (
  'success' => false,
  'endpoint' => 'https://updates.push.services.mozilla.com/wpush/v1/gAAAAABYNX0F_-z03mY2cPTxDhnaTtloaaCR8Uf1HDvuyxso14jo3fJVd7GUDjqyMwThrmKHsQJYhb3WyGN-OMpxPcdcl68stMzDVUbiiuWsQfFRPwyCl4u1p6IhQ1JD2wDi0rQJc8Lu',
  'statusCode' => 413,
  'headers' => 
  array (
    0 => 'HTTP/1.1 413 Request Entity Too Large',
    1 => 'Access-Control-Allow-Headers: content-encoding,encryption,crypto-key,ttl,encryption-key,content-type,authorization',
    2 => 'Access-Control-Allow-Methods: POST',
    3 => 'Access-Control-Allow-Origin: *',
    4 => 'Access-Control-Expose-Headers: location,www-authenticate',
    5 => 'Content-Type: application/json',
    6 => 'Date: Wed, 23 Nov 2016 11:51:11 GMT',
    7 => 'Content-Length: 270',
    8 => 'Connection: keep-alive',
  ),
  'content' => '{"errno": 104, "message": "This message is intended for a constrained device and is limited to 3070 bytes. Converted buffer too long by 1366 bytes", "code": 413, "more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes", "error": "Payload Too Large"}',
  'expired' => false,
)

example with vapid:

$webPush = new Minishlink\WebPush\WebPush(array (
  'VAPID' =>
  array (
    'subject' => 'mailto:[email protected]',
    'publicKey' => 'BKLEYumnBJcixlp80yrha1Ic8UffdM1FZeOmQvTu/8JTueDS7c3vdAawINeQ88oAmpPMwMvn8qsqhbH5TVDRSDY=',
    'privateKey' => '9q+dAHTOvtKAmaiIUih4kpxhB+1DRFm/v7kUOB9hDus=',
  ),
));
$result = $webPush->sendNotification(
    'https://updates.push.services.mozilla.com/wpush/v2/gAAAAABYNXHS_TLCbunVKuMYcXH_k3KTbzdUgqZQw0HHpMZnGZ2zD3g2JrWNlOdUWcwYrLqzouml7F-tFMsrAihKmw49y2WIRe9b43uMe43QSFq-ugUX5T3WctqufDrTlGMzFa-d8OW_EsjQxGXrz93d7G8T4bLhGqrBVSJawT3jTRbbDKb3sV8',
    '{"title":"title","body":"body","icon":"/favicon.ico","uri":"\/"}',
    'BM/8r/zjQr5CWDM4dp/woA7mUWBV0fUfxaCcnq8X7U+rIWm8dNbmRXZ1GRLtau4qslFIaUJExQl7DYEnscqCljI=',
    '++2SVwj4Ps/fLp8/PWSQOQ==',
    true
);

result with vapid:

array (
  'success' => false,
  'endpoint' => 'https://updates.push.services.mozilla.com/wpush/v2/gAAAAABYNXHS_TLCbunVKuMYcXH_k3KTbzdUgqZQw0HHpMZnGZ2zD3g2JrWNlOdUWcwYrLqzouml7F-tFMsrAihKmw49y2WIRe9b43uMe43QSFq-ugUX5T3WctqufDrTlGMzFa-d8OW_EsjQxGXrz93d7G8T4bLhGqrBVSJawT3jTRbbDKb3sV8',
  'statusCode' => 413,
  'headers' => 
  array (
    0 => 'HTTP/1.1 413 Request Entity Too Large',
    1 => 'Access-Control-Allow-Headers: content-encoding,encryption,crypto-key,ttl,encryption-key,content-type,authorization',
    2 => 'Access-Control-Allow-Methods: POST',
    3 => 'Access-Control-Allow-Origin: *',
    4 => 'Access-Control-Expose-Headers: location,www-authenticate',
    5 => 'Content-Type: application/json',
    6 => 'Date: Wed, 23 Nov 2016 11:56:11 GMT',
    7 => 'Content-Length: 270',
    8 => 'Connection: keep-alive',
  ),
  'content' => '{"errno": 104, "message": "This message is intended for a constrained device and is limited to 3070 bytes. Converted buffer too long by 1366 bytes", "code": 413, "more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes", "error": "Payload Too Large"}',
  'expired' => false,
)

I checked on the same device https://gauntface.github.io/simple-push-demo/. This demo working for Firefox on Android.

My payload very small.

What is the problem?

@Minishlink
Copy link
Member

Apparently Firefox for Mobile has restrictions of payload length.
I filled an issue on mozilla-services/autopush#748 since it's not a standard behavior.

In the meantime, you can disable automatic padding.

@Minishlink
Copy link
Member

To sum up, they have no easy way of supporting the standard 4096 bytes length and I don't feel a lot of enthusiasm to do so.

I'll decrease the padding length, and update the README, in order to have more "out-of-the-box" compatiblity.

Thanks for your feedback!

@Minishlink
Copy link
Member

Check out the release v1.3.3 :)

@albertsylvester
Copy link

albertsylvester commented Jan 7, 2017

Dear Minishlink,

Yeah, Why did I get this error in Firefox android?
"errno": 105, "message": "Request did not validate Critical Failure: Client is unreachable due to a configuration error. Unable to send message

Array ( [0] => Array ( [success] => [endpoint] => https://updates.push.services.mozilla.com/wpush/v2/gAAAAABYcXhkmxpJQyL2gMvSHlkRIRMePd8vz0w4ZFFF82Whz7zPzzNjnaOXXWyaQ2VIl6nmcfXhKljeDG6dw34UWW12bl1zMXO7oVmzV2xKBOoOdhN30Sg9bX1gmXGa-ow1Rf9UbIbqEhqFAAhGknLlpolC6DKo4x2fl_4QOmTm3dKkXXXXXX [statusCode] => 410 [headers] => Array ( [0] => HTTP/1.1 410 Gone [1] => Access-Control-Allow-Headers: content-encoding,encryption,crypto-key,ttl,encryption-key,content-type,authorization [2] => Access-Control-Allow-Methods: POST [3] => Access-Control-Allow-Origin: * [4] => Access-Control-Expose-Headers: location,www-authenticate [5] => Content-Type: application/json [6] => Date: Sat, 07 Jan 2017 23:44:42 GMT [7] => Server: nginx [8] => Content-Length: 252 [9] => Connection: keep-alive ) [content] => {"errno": 105, "message": "Request did not validate Critical Failure: Client is unreachable due to a configuration error. Unable to send message.", "code": 410, "more_info": "http://autopush.readthedocs.io/en/latest/http.html#error-codes", "error": ""} [expired] => 1 ) )

Thank you

Warm regards,

Albert

@Minishlink
Copy link
Member

Hi Albert, that must be a bug from the bridge between Firefox autopush and Google notification service. I can't help you, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants