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

Apple web push causing errors #97

Open
briwg opened this issue Jan 16, 2023 · 8 comments
Open

Apple web push causing errors #97

briwg opened this issue Jan 16, 2023 · 8 comments

Comments

@briwg
Copy link

briwg commented Jan 16, 2023

Hi,

I'm starting to see registrations for Apple web push and they are causing errors such as:

Exception thrown: 'System.AggregateException' in mscorlib.dll
An exception of type 'System.AggregateException' occurred in mscorlib.dll but was not handled in user code
One or more errors occurred.

I'm using the latest version of the dll.

Thanks

Brian

@keke1210
Copy link

@briwg based on the readme file, the Safari browser is not supported.
image
Meanwhile, on the node.js package(https://github.com/web-push-libs/web-push), the safari browser is supported

@briwg
Copy link
Author

briwg commented Jan 19, 2023

Yes, I understand that. However, the point is that people can land on my website using IOS Safari and subscribe to Push Notifications. When I then send out a PN an uncaught exception is thrown by the dll when the apple endpoint is encountered and my sender errors and stops. I have put a workaround in place, but the dll in my view should either a) handle the exception internally b) be updated to support Apple IOS push notifications since it appears they are now finally being rolled out.

@keke1210
Copy link

@briwg I am rooting for option b.

@7702244
Copy link
Contributor

7702244 commented Jan 23, 2023

Safari for MacOS have full support for standard PUSH API which works perfectly with this library. According to presentation, support for iOS and iPadOS will appear next year.

But unfortunately, the library looks abandoned and is no longer being developed.

WebPush for Safari

@Stratster
Copy link

So i believe i have found the issue here...

After searching through the differences from the main js project and this one, i noticed that this library does not support the content encoding AES_128_GCM which is required by safari as you can see in the Authorization header description here:
Send push notifications to Safari users

This feature is requested since 2018...: 44

@DaBeSoft
Copy link

DaBeSoft commented Apr 13, 2023

I ran into a similar (but maybe not the same) problem where I got "403 - BadJwtToken" as an error.

The solution to my problem was to remove the "<" and ">" from the mailto in the VAPID subject (from mailto:<mail@example.com> to mailto:mail@example.com).
It seems that Apple does not like them. (see https://stackoverflow.com/questions/75547851/sending-push-notifications-to-safari-from-java)

Push notifications now work fine for me (Safari on iOS) using this library. Hope this helps.

@briwg
Copy link
Author

briwg commented Apr 30, 2023

DaBeSoft do you know if this works with iOS and iPadOS 16.4 devices which support web push?

See: https://webkit.org/blog/13878/web-push-for-web-apps-on-ios-and-ipados/

@DaBeSoft
Copy link

DaBeSoft commented May 2, 2023

Yes, it does work, but afaik the web app needs to be added to the homescreen for Push Notifications to work on iOS / iPadOS (as described in your link).

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

5 participants