Skip to content

Get friends display name (Alias) using XMPP IOS - Swift  #85

@JoseTovar94

Description

@JoseTovar94

I need to get the display name or Alias of friends using XMPP and XMPPFramework. Please help.

try with the following code

func xmppRosterDidEndPopulating(_ sender: XMPPRoster) {
        if let jids = xmppRoster.xmppRosterStorage.jids(for: stream) as? [XMPPJID] {
            print("JIDS: \(String(describing: jids))")
            for item in jids {
                print(item.user)
                listContacts.append(item.user!)
            }
        }
        
    }

this prints the user and not the name or alias (nickname)

example, a contact has:
user = test@dominio.com
name = test 2

the previous method prints the user. the output of "print(item.user) = test@dominio.com" and not the name in this case would be "name = test 2".... the print(item.user) return the User but not the alias (nickname)

How do I get the name, alias (nickname)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions