【问题标题】:How can I get the account type of the contacts in Zebble for Xamarin?如何在 Zebble for Xamarin 中获取联系人的帐户类型?
【发布时间】:2017-10-10 05:17:50
【问题描述】:

我需要在我的应用程序中显示联系人并与实例消息传递应用程序(例如 WahtsApp 等)建立连接,因此我将此代码添加到我的应用程序中,但我无法从中找到帐户类型。

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

【问题讨论】:

  • 帐户类型是什么意思?

标签: c# xamarin xamarin.android xamarin-zebble zebble


【解决方案1】:

要获取联系人的帐户类型或帐户 ID,您可以在联系信息中使用 InstanceMessaging 属性,如下所示,有关更多信息,您可以查看下面的链接。

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

对于获取 userId,您可以使用 UserId,对于帐户类型,您可以使用 Service 属性。

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

免责声明:我是 Zebble 项目的贡献者并从事技术支持。

【讨论】:

    猜你喜欢
    • 2012-04-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-01-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多