How to implement XMPP to send push notifications

后端 未结 2 2044
广开言路
广开言路 2021-01-31 21:50

I would like to use XMPP so that my application will send out updates to an android phone (1.5 and higher). I pretty much want to use XMPP to send push notifications to the phon

2条回答
  •  不要未来只要你来
    2021-01-31 22:42

    Generally, you would implement this as a pub-sub feature. Pub-sub is basically the publish/ subscribe paradigm: you publish something and they receive it.

    Assuming you have an XMPP server setup that supports the pub-sub protocol extension (like eJabber), in your app, you would login to that server and subscribe to a node (where your update notifications would be sent), and with your subscription you would have to add a handler to handle any notification on that node.

    On the server side, when you have something that all of your clients need to know about, you would publish the update to the same node that the clients subscribe to.

    For more info, see http://xmpp.org/extensions/xep-0060.html

提交回复
热议问题