问题
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