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

前端 未结 2 1589
广开言路
广开言路 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: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.

提交回复
热议问题