简体   繁体   中英

How can I get the account type of the contacts in Zebble for Xamarin?

I need to show contacts in my application and make a connection with Instance Messaging application such as WahtsApp and the others, so I added this code to my application but I could not find the account type from it.

var contacts = await Device.Contacts.GetAll();
foreach (var contact in contacts)
{
    // find contacts has connection with other applications
}

To get account type or account id of the contact you can use InstanceMessaging property in contact information like below and for more information, you can see link below.

var contacts = await Device.Contacts.GetAll();
foreach (var contact in contacts)
{
    if (contact.InstantMessagingAccounts.Any())
    {
        var connections = contact.InstantMessagingAccounts;
    }
}

And for getting userId you can use UserId and for account type, you can use Service property.

http://zebble.net/docs/accessing-device-contacts

Disclaimer: I am a Zebble project contributor and engage in technical support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM