Open ghost opened 9 years ago
If we used Link
headers instead of JSON entity bodies, we'd end up with Web Push's "registration" and "subscription" flows. :smile_cat:
I'd argue a bit differently. I agree that the websocket requirement is a pain, but I'd also argue that for this, we don't need the separate "Hello". For many cases, the UAID is either known or is not specified which means that it's created new. I could also argue that in many cases applications have one channel, but that's a separate concern.
I think having a single "registration" point where you pass the UAID (either known or blank) and ChannelID and get back a response containing UAID & EndPoint is sufficient in most cases. z
I suppose that if we really wanted, we could make the same registration endpoint return just a new UAID if the user doesn't specify a CHID.
Granted, tying the UAID to the user for any other reason becomes more of a concern, but that's not really our concern either.
I think having a single "registration" point where you pass the UAID (either known or blank) and ChannelID and get back a response containing UAID & EndPoint is sufficient in most cases.
Excellent. Correlating IDs to users does become more challenging, but we could argue this is a proprietary mechanism, anyway—"use at your own risk."
For proprietary pingers that can bypass the WebSocket (i.e., GCM and APNS), it doesn't make much sense for the client to initiate a WebSocket connection, send a handshake with the
connect
field, and then disconnect. What if we exposed HTTP endpoints for these, too?And for registering channels:
(There's no need to include the device and channel IDs in the body if they're already in the URI; I just used the same
hello
andregister
message formats for clarity).