XMPPFramework:我可以确定用户的在线/离线状态吗?
如何使用 iPhone 版 XMPPFramework 确定用户是否在线/离线?
我有他们的 JID 等。有没有办法请求出席或其他什么?
谢谢。
How would I determine if a user is online/offline using XMPPFramework for iPhone?
I have their JID etc etc. Is there a way of requesting a presence or something?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您检查过 XMPPFramework 示例项目的源代码吗?
如果我没记错的话,这应该是相关的代码片段:
并且您的流委托获得的回调应该是
我假设您已经拥有 xmmpframework 源,如果没有,您可以在此处克隆存储库
示例项目位于“Xcode”中文件夹。
Have you checked out the source code of the XMPPFramework sample project?
If I remember correctly, this should be the relevant code snippet:
And the callback your stream delegate gets should be
I assume that you already have the xmmpframework source, if not, you can clone the repository here
The sample projects are in the "Xcode" folder.
首先,必须需要 ROSTER List 中的双方订阅才能获取用户状态。
此处,如何订阅&接受出席请求。
如果您的朋友向您发送预授权请求,那么您会在名册代表中收到请求。
完成上述步骤后,您将在下面的 XMPP 委托方法中收到您朋友的在线/离线状态。
First, Both side subscription in ROSTER List is must required for getting user status.
Here, How to subscribe & Accept a Presence Request.
If your friend send precense request to you then you received request in Roster Delegate.
Once the above steps did you will receive your friend Online/Offline Status in the below XMPP delegate method.