Skip to content

MS Edge Sending Problem #174

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

Closed
9 of 15 tasks
ozgurhangisi opened this issue Jun 19, 2018 · 2 comments
Closed
9 of 15 tasks

MS Edge Sending Problem #174

ozgurhangisi opened this issue Jun 19, 2018 · 2 comments

Comments

@ozgurhangisi
Copy link

ozgurhangisi commented Jun 19, 2018

NOTE: Please test in a least two browsers (i.e. Chrome and Firefox). This
helps with diagnosing problems quicker.

Please confirm the following:

  • I have read the README entirely
  • I have verified in the issues that my problem hasn't already been resolved

Setup

Please provide the following details, the more info you can provide the
better.

  • Operating System: Linux
  • PHP Version: 7.1.9
  • web-push-php Version: 4.0.2

Please check that you have installed and enabled these PHP extensions :

  • gmp
  • mbstring
  • curl
  • openssl

Please select any browsers that you are experiencing problems with:

  • Chrome
  • Firefox
  • Firefox for Mobile
  • Opera for Android
  • Samsung Internet Browser
  • Other : MS EDGE

Please specify the versions (i.e. Chrome Beta, Firefox Beta etc).
Windows 10 - 1803. (Edge Version : 17.17134)

Problem

I use this library for more than a year without any problem. I can send WebPush to Chrome, Firefox, Opera, Yandex Browser without any problem. But I couldn't send any Webpush to Edge browser.

So the error is : Client error: POST https://bl2p.notify.windows.com/w/?token=XXXX resulted in a 401 Unauthorized response.

I tried both aesgcm and aes12gcm. I get the same error.

Please explain what behaviour you are seeing.

I get Client error: POST https://bl2p.notify.windows.com/w/?token=XXXX resulted in a 401 Unauthorized response.

Expected

Please explain what you expected to happen

Features Used

  • VAPID Support
  • GCM API Key
  • Sending with Payload

Example / Reproduce Case

$payload = '{"n":"1","title":"NetWork","body":"Body","zbid":16515,"icon":"//dbfukofby5ycr.cloudfront.net/m47/1/1467/d1708/37940-l.jpg","image":"//dbfukofby5ycr.cloudfront.net/m47/1/1467/d1801/9f032-webpush_network.jpg","link":"https://www.webinstats.com/products"}';
$webPush = new WebPush($Authentication,Array(),20,Array('verify'=>false));
$webPush->setAutomaticPadding(false);
for($i=0;$i<count($subscriptions);$i++) {
$subscription = Subscription::create([
'endpoint' => $subscriptions[$i]['END_POINT'],
'publicKey' => $subscriptions[$i]['USER_PUBLIC_KEY'],
'authToken' => $subscriptions[$i]['USER_TOKEN'],
'contentEncoding'=>$subscriptions[$i]['CONTENT_ENCODING']
]);
$webPush->sendNotification($subscription,$payload,false);
}

$res_final = $webPush->flush();
print_r($res_final);

Please provide a code sample that reproduces the issue. If there is a
repository that reproduces the issue please put the link here.

Other

Please put any remaining notes here.
Thanks :)

@ozgurhangisi
Copy link
Author

Hi Guys, Finally I found the problem. For Edge browser, Endpoint length must be more around 403 chars. In db I stored endpoint in varchar 400 field. So It doesn't get full endpoint URL. Finally I altered db field to varchar(512) and problem solved.

@grizzly
Copy link

grizzly commented Jan 22, 2021

Hi Guys, Finally I found the problem. For Edge browser, Endpoint length must be more around 403 chars. In db I stored endpoint in varchar 400 field. So It doesn't get full endpoint URL. Finally I altered db field to varchar(512) and problem solved.

Oh man, sometimes its that easy :-) Thanks for that.

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

2 participants