Comments (8)
(I'll also note that pywebpush
exposes a parameter for headers
for things like this. It does mean that the calling code needs to know the TTL
is 0, so it applies the correct caching header, but it's a reasonable work-around)
from pywebpush.
Ah, thanks for the bump on this.
I was waiting for a review. Apparently from Godot.
I'm going to update it to include an error to check for the X-WNS-Type
header if --wns
is specified as a flag.
from pywebpush.
Ah, looks like there are several headers that they want.
I'm half tempted to put these under an option flag just in case they might mess up Apple or Google for some stupid reason.
from pywebpush.
I have been trying to make this work (web push to Edge from a Flask app using this library) and was about to give up on Edge until I successfully sent a web push to Edge using the Node web-push library from the command line. After seeing the notes in the issue, I took a look in the Node library code for wns headers and found none. Just FYI
from pywebpush.
My code now works after adding only a ttl value after seeing the npm module has a large default value.
Looking at the MS doc mentioned earlier many of the headers are optional.
from pywebpush.
Right, X-WNS-Type
is marked as a required field (as either tile
, toast
, badge
or raw
, with the Content-Type
set to text/xml
except if raw
where it's set to application/octet-stream
.)
I can do some simple checks to make sure folk are sending the right format, but this is all fairly non-standard and a lot of extra work. I'm also just tempted to add some content to the README talking about how non-standard this is and what extra stuff you need to do to send notification messages to Windows computers.
from pywebpush.
Ok, so here's the deal.
I'm not going to add any special handling for WNS. In fact, I'm going to take this opportunity to drop the special handling we were doing for GCM/FCM, since that's going away in less than 2 months and has been obsolete for nearly a year now.
If you want to use this library with WNS, you have to add the headers yourself, since they're subject to change anyway. I've added a note in the README for what you'll need to do.
If you were using this to talk to GCM/FCM directly and not using Web Push, this is your wake-up call that you really, really need to stop doing that.
from pywebpush.
from pywebpush.
Related Issues (20)
- Send Push to Offline Devices (When it comes Online) HOT 7
- Feature: get the encoded data ready for sending (for async interop) HOT 1
- Error : Web push send from python backend to fire base using VAPI keys. Unhashable type:'slice' HOT 7
- use unittest.mock instead of mock
- JWT token being refreshed too often HOT 8
- Error : Web push send from python backend HOT 4
- Async Send Function HOT 1
- Unauthorized error while sending notifications to edge device
- Is the library being maintained HOT 2
- Grouping of multiple notification not working
- Defination of payload HOT 1
- netrc may override authorization header.
- How to set the `aud` for localhost HOT 2
- CryptographyDeprecationWarning: Curve Argument Type Issue in pywebpush
- For edge, I only get 400 Bad Request. I tested it in webpush library for node. It works properly. HOT 4
- Is there a way to set topic for replacing old messages? HOT 1
- No error thrown, but no push notifications received HOT 2
- Drop six usage
- Use classifier for license in pyproject.toml
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pywebpush.