How the XMPP client must notified of new Message, when app is in background?

后端 未结 1 1573
面向向阳花
面向向阳花 2021-01-23 23:57

Considering OPENFIRE not supports XEP-0357 (Push Notification), then how the client must notified of new messages? Does the user connection must be always AVAILABLE? But in othe

相关标签:
1条回答
  • 2021-01-24 00:55

    I founded my answer myself. I developed a local API in my server, to send push notification. This local API will have all the users tokens per jids (when Token generated in my app, sends a packet via rest to my API). When a user is offline, openfire server will use CallBackOnOffline plugin to send POST request containing a JSON of message body and sender and receiver to my local API. Then the API will gets the destination Token from db and sends a request of push to FCM.

    Note: CallBackOnOffline has a problem in openfire that not sends POST requests. I solved that too. If anyone faced with this problem, comment it, I'll give it's solution too.

    0 讨论(0)
提交回复
热议问题