【问题标题】:Mobile device's Contact list within the app's UI应用程序 UI 中的移动设备联系人列表
【发布时间】:2018-12-06 00:35:21
【问题描述】:

我在Ionic 3 应用程序上使用Contacts 原生插件。它工作正常。但是您知道如何在应用程序的 UI 中实现它吗?此时它是(contact list)在应用程序外部加载。选择联系人后,它会返回应用程序的 UI。任何线索?因为它是手机的原生功能,所以这是不可能的吗?

 ionViewDidEnter() {  
     if (this.platform.is('cordova')) {
        this.contacts.pickContact().then(response => {
         });
      }
  }

像这样:我从Zoiper app 中提取了这个。我们可以使用Ionic 3 来做到这一点吗?

【问题讨论】:

    标签: css angular typescript ionic3 cordova-plugins


    【解决方案1】:

    您可以获得这样的联系人列表:

    import { Contacts, ContactFieldType, ContactFindOptions } from '@ionic-native/contacts';
    
     constructor() {
    
        Contacts.find(['displayName', 'name', 'phoneNumbers', 'emails'], {filter: "", multiple: true})
        .then(data => {
          this.allContacts = data
        });
    

    然后使用 allContacts

    创建一个可点击的列表或您想要的列表

    【讨论】:

    • 我认为这不是一件容易的事,因为原生联系人组件有很多功能。即搜索/排序/字母搜索等。希望没有方法可以将该组件直接包含到应用程序的 UI 中吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-18
    • 2012-11-21
    相关资源
    最近更新 更多