![](/img/trans.png)
[英]Push notification is sent to the user that sends the message and not to the receiver
[英]Message not received when sent through send_message endpoint of Ejabberd Api if the receiver user was offline
我正在實現聊天應用程序,但我不明白為什么當我使用 ejabberd 的模塊Send_message時,接收者看不到消息。
我是說:
用戶 B 離線,用戶 A 使用 ejabberd api 通過 https 發送消息。 **
當用戶 B 上線時,他什么也看不到 ***
我在客戶端使用 smack 並實現了傳入消息的偵聽器。 但我沒有看到帶有消息擴展名的傳入數據包
我無法重現該問題。
這就是我測試它的方式:
安裝ejabberd 21.04,默認配置,啟動
注冊賬戶 user1@localhost 和 user2@localhost
使用 shell 發送消息(無需設置 API):
❯ ejabberdctl send_message chat user1@localhost user2@localhost somesubject 某人
然后使用一個好的桌面 Jabber 客戶端登錄到賬戶 user2@localhost,例如 Gajim, Psi, Tkabber, ... 登錄后,客戶端收到
<message to='user2@localhost' from='user1@localhost' type='chat' id='13012384106679348680'> <archived by='user2@localhost' id='1621974627878891' xmlns='urn:xmpp:mam:tmp'/> <stanza-id by='user2@localhost' id='1621974627878891' xmlns='urn:xmpp:sid:0'/> <delay from='localhost' stamp='2021-05-25T20:30:27.879994Z' xmlns='urn:xmpp:delay'>Offline storage</delay> <body>somebody</body> <subject>somesubject</subject> </message>
你必須嘗試的事情:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.