angular - Ionic 4 Cordova 联系人插件在 PWA 中不起作用
问题描述
Ionic 4 Cordova 联系人插件在 PWA 中不起作用
ionic cordova plugin add cordova-plugin-contacts
npm install @ionic-native/contacts
public contacts: Contacts
const contactsList = this.contacts.find(['*']);
if (contactsList !== undefined) {
contactsList.then(function(value) {
self.everybody = value;
// do print
self.everybodyDuplicate = self.everybody;
self.everybody = self.everybody.sort(function (a, b) {
var x =a.name.givenName;
var y =b.name.givenName;
if (x < y) return -1;
else if (x > y) return 1;
return 0;
});
});
}
有一些错误:
ERROR 错误:未捕获(承诺中):TypeError:navigator.contacts.find 不是函数
解决方案
推荐阅读
- cmake - CMake add_library 与未来的来源
- sql - Sqlite 连接两个表
- python - ModuleNotFoundError:没有名为“tensorflow.python.keras.applications.MobileNetV2”的模块
- python - 显示列表元素,就好像它们是输入的一样
- javascript - 具有对象的数组 -> 格式化为字符串的数组
- kubernetes - 如何从 Grafana 仪表板中隐藏已终止的 pod
- python - 比较标记数据的最大值
- css - 如何创建具有平滑弯曲边框的 div
- javascript - 将 HTML 从 Json 属性绑定到表
- node.js - 如何在mongodb中添加多个相同类型的文档