-
Notifications
You must be signed in to change notification settings - Fork 30
410 error just after registration #997
Comments
First off, the "/registration" call you're making isn't really what you think it is. That's for mobile devices that use a known bridge system like GCM or APNS. (We currently allow an arbitrary string there for testing, but we really should limit to just the allowed bridge types in order to avoid this level of confusion.) The reason it's instantly 410 is because the system believes it needs to send a message to the "11-TESTING-11" bridge, which doesn't exist, fails, and returns the 410. Now, getting back to the heart of your issue, I think you may misunderstand how WebPush works. WebPush is a way for an App on a browser to get messages. All the connection stuff is handled for you by the browser. MDN has documentation on the Push API, which describe how Apps get started. You can also look at serviceworke.rs for code samples and live demos. As for the notification publishers (usually called the app servers), I've written a few articles that might be useful. Does that help you? |
Thanks for the quick answer @jrconlin ! What I want to do in fact is what the browser does when it call subscribe, and is really difficult to find documentation about. I want to be able to use WebPush inside a command line app (in Python or NodeJS for instance), or even a GUI App (what is important here is that I can't rely on the browser to do this for me). So as far as I understand I need to able able to register to some Push backend, like GCM/FCM, but those 2 requires an InstanceID, which is a complete black box. So I tried |
Sorry for the late reply. So, you probably really don't want to do what you're trying. Technically, it's possible, but it's a significant hassle and definitely not supported. Here's a rather long explanation that I hope helps. Technically, the WebPush RFC specifies how User Agents (e.g. Firefox, Chrome, Edge, etc.) can connect to the Push Service (autopush, GCM, MSNotifications, etc.). They're supposed to use HTTP2 with slightly modified frame usage. In reality, none of the WebPush providers actually do that. There's a lot of reasons for that, some legacy, some inertia, all of those reasons are pretty valid. Mostly because each User Agent only ever talks to its own Push Service. Chrome will never use our Push Service* and vice versa, nor will we ever use Microsoft's or Brave, or really, anyone else. This is kind of a good thing because nothing is free and while Web Push doesn't cost you anything, we do pay a bill every month. We're fine paying the costs for all of our machines, but I don't think our accountants would be thrilled if we had to carry Chrome's userbase too. Finally, WebPush is designed to be secure and easy for Apps, but there are FAR better protocols out there for connecting up devices. XMPP has a far richer protocol, PubSubHubBub deals with "broadcast" better, etc. Heck, if you're not connecting up a lot of devices or just want to play around a little, AWS Greengrass is a neat little messaging system for IoT stuff. WebPush doesn't do broadcast, requires data encryption, a full time connection and a bunch of other things that may frustrate you more than help. May sound kinda odd coming from one of the folks that pushed hard for this, but I also realize that not all tools are good for all things. Sometimes you really want a hammer and that screwdriver just won't cut it. (*Ok, technically we use google as a bridge, and they use our servers to handle some traffic, but that's weird and fuzzy and headache inducing.) |
@jrconlin thanks for the detailed explanation ! And thank you for the alternatives 👍 |
I'm trying to get hands on the API, and I don't get why I'm getting a
410
error.Register to webpush, this works:
I get a successful response:
But if I'm trying to send a message to the endpoint (with web-push), I'm getting the following error:
Why would the endpoint be instantly invalid ?
The text was updated successfully, but these errors were encountered: