how to handle Decline Action on XMPP Framework - Objective C

与世无争的帅哥 提交于 2019-12-23 01:52:34

问题


I have implemented group chat using XMPP Framwork. I am able to connect, send and receive messages between both parties.

But their is an issue in getting the status when and Agent on other side Decline my request. None of delegate is calling when Agent Decline the request. Here is my code.

- (void)setupStream {

_xmppStream = [[XMPPStream alloc] init];
[_xmppStream addDelegate:self delegateQueue:dispatch_get_main_queue()];
[_xmppStream setHostName:kChatUrl];
[_xmppStream setHostPort:5222];


_xmppMUC = [[XMPPMUC alloc] initWithDispatchQueue:dispatch_get_main_queue()];
[_xmppMUC   activate:_xmppStream];

[_xmppMUC addDelegate:self delegateQueue:dispatch_get_main_queue()];

}

Here is Delegate Methods

- (void)xmppMUC:(XMPPMUC *)sender roomJID:(XMPPJID *)roomJID didReceiveInvitationDecline:(XMPPMessage *)message
 {
   [self.delegate gatwayAgentDeclinedChatRequest];
 }


 - (void)xmppMUC:(XMPPMUC *)sender roomJID:(XMPPJID *) roomJID didReceiveInvitation:(XMPPMessage *)message
 {

     NSLog(@"%@", message);  //This is being Called

 }

I have setup these delegates:

  <XMPPStreamDelegate, XMPPMUCDelegate, XMPPRoomDelegate>

I also Checked SO for any solution but couldn't find anything. One Link I refered is this. But This link doesn't solved my issue.

Whenever I pressed this decline button nothing happens. none of my xmpp delegate are being called. But when I accept everything works perfect.

来源:https://stackoverflow.com/questions/38246337/how-to-handle-decline-action-on-xmpp-framework-objective-c

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!