Google Cloud Messaging - CCS (XMPP) vs HTTP server

前端 未结 5 1324
执念已碎
执念已碎 2020-12-30 03:53

I\'ve read the documentation https://developer.android.com/google/gcm/index.html

and the only difference I can see is that a CCS (XMPP) based server allows bi-direct

5条回答
  •  攒了一身酷
    2020-12-30 04:17

    XMPP messaging differs from HTTP messaging in the following ways:

    Upstream/Downstream messages

    • HTTP: Downstream only, cloud-to-device.
    • XMPP: Upstream and downstream (device-to-cloud, cloud-to-device).

    Messaging (synchronous or asynchronous)

    • HTTP: Synchronous. App servers send messages as HTTP POST requests and wait for a response. This mechanism is synchronous and blocks the sender from sending another message until the response is received.
    • XMPP: Asynchronous. App servers send/receive messages to/from all their devices at full line speed over persistent XMPP connections. The XMPP connection server sends acknowledgment or failure notifications (in the form of special ACK and NACK JSON-encoded XMPP messages) asynchronously.

    JSON

    • HTTP: JSON messages sent as HTTP POST.
    • XMPP: JSON messages encapsulated in XMPP messages.

    Plain Text

    • HTTP: Plain Text messages sent as HTTP POST.
    • XMPP: Not supported.

    Multicast downstream send to multiple registration tokens.

    • HTTP: Supported in JSON message format.
    • XMPP: Not supported.

提交回复
热议问题