iOS XMPPFramework-如何获取MUC消息的昵称?
当我使用XMPPFramwork加入MUC房间时,我会通过委派方法收到新消息:iOS XMPPFramework-如何获取MUC消息的昵称?,ios,xmppframework,multiuserchat,Ios,Xmppframework,Multiuserchat,当我使用XMPPFramwork加入MUC房间时,我会通过委派方法收到新消息: func xmppRoom(sender: XMPPRoom!, didReceiveMessage message: XMPPMessage!, fromOccupant occupantJID: XMPPJID!) { } 如何获取发送邮件的用户的昵称 我尝试了message.from().user,但没有打印昵称 我现在使用message.fromStr())!。lastPathComponent但这感觉非
func xmppRoom(sender: XMPPRoom!, didReceiveMessage message: XMPPMessage!, fromOccupant occupantJID: XMPPJID!) {
}
如何获取发送邮件的用户的昵称
我尝试了message.from().user
,但没有打印昵称
我现在使用message.fromStr())!。lastPathComponent代码>但这感觉非常错误
有更好的方法吗?我知道这已经太晚了,但是,这个答案可能会帮助其他人,所以我发布了答案
// this statement gives sender's nick name
message.attributeForName("from").stringValue
希望这有帮助。尝试以下内容:
Message.from().resource