XMPP框架-如何获取群组消息
我正在开发一款具有群聊功能的 iPhone 应用程序。
我正在使用 XMPP 框架。但我无法获取已收到的消息,然后将其传递给视图控制器以打印它。
我能够打印一对一的消息,但框架处理组消息的方式不同。
任何线索将不胜感激。
Im developing an iPhone app that has an groupchat.
Im using the XMPP framework. But im not able to pick up the message that has been received and then pass it to the Viewcontroller in order to print it.
Im able to print one on one messages, but the way the framework deals with groupmessages is different.
Any clue will be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本上,您必须创建一个委托来调用在视图控制器中实现的方法。
通过这种方式,appDelegate(唯一知道收到消息的人)将执行在视图控制器中实现的方法。然后视图控制器将能够打印收到的消息。
Basicly you have to create a delegate that will call a method that is implemented in the viewcontroller.
In such way that the appDelegate(who is the only one to know that a message is received) will execute a method that is implemented in the viewcontroller. Then the viewcontroller will be able to print the received message.
每当您收到群组消息时,都会调用以下委托方法:
Whenever you will receive a group message, following delegate method will be called: