didReceiveInvitation() is not being called in XMPPFramework and Swift 2

前端 未结 2 1545
广开言路
广开言路 2021-01-24 08:24

I am creating chatting application like Whatsapp.
I have successfully write the functionality of Text chat, Image, Audio, Video Transfer. Now I am creating

相关标签:
2条回答
  • 2021-01-24 08:41

    If you set a breakpoint in file XMPPMUC.m line 317

    - (void)xmppStream:(XMPPStream *)sender didReceiveMessage:(XMPPMessage *)message
    

    Is that method being called when an invitation is sent to your user? If so keep debugging and check if line 382 is being executed.

    That line has this:

    [multicastDelegate xmppMUC:self roomJID:roomJID didReceiveInvitation:message];
    
    0 讨论(0)
  • 2021-01-24 08:47

    Problem was in this code. Actually i was sending the bare id every time when i was inviting any user.

    func xmppRoomDidJoin(sender: XMPPRoom!) {
            sender.fetchConfigurationForm()
            for JID in membersToInvite! {
                sender.editRoomPrivileges([XMPPRoom.itemWithAffiliation("member", jid: XMPPJID.jidWithString(JID))])
                sender.inviteUser(XMPPJID.jidWithString(JID), withMessage: "THIS IS GROUP MESSAGE")
    
            }
    
        }
    

    BUT TO INVITE ANY USER YOU HAVE TO USE FULL ID.

    For those who dont know

    BareID = username@domain FullID = username@domain/resource

    To resolve this

    I hardcode the resource = APPNAME everywhere in JIDs in whole app.

    0 讨论(0)
提交回复
热议问题