我拿华为真机测试 返回的数据获取不到电话号码
{"id":809,"rawId":null,"target":0,"displayName":"殷","name":null,"nickname":null,"phoneNumbers":[],"emails":null,"addresses":null,"ims":null,"organizations":null,"birthday":null,"note":null,"photos":[],"categories":null,"urls":null},
下面的是代码
plus.contacts.getAddressBook(plus.contacts.ADDRESSBOOK_PHONE,
function(addressbook) { //获取通讯录信息
// 可通过addressbook进行通讯录操作
addressbook.find(["id","displayName","phoneNumbers.mobile","note","photos"], function(contacts) {
console.log(JSON.stringify(contacts))
}, function(e) {
alert("Find contact error: " + e.message);
});
}, function(e) {
alert("Find contact error: " + e.message);
});
3 个回复
i***@qq.com
遇到了同样的问题,求解答~
伊豆 - 淡定
//获取通讯录对象
plus.contacts.getAddressBook( plus.contacts.ADDRESSBOOK_PHONE, function( addressbook ) {
console.log("----addressbook -----:",addressbook);
});
为什么我感觉调不通,是不是有什么前置条件。
伊豆
没问题,我打印日志的地方不对
2019-09-16 20:01
FullStack - 【插件开发】【专治疑难杂症】【ios上架、马甲包、白包、过审、已成功上架过几百个】【多款插件已上架:https://ext.dcloud.net.cn/publisher?id=22130】【非诚勿扰】QQ:543610866
通讯录选择联系人、可单选、多选、详情(ios):https://ext.dcloud.net.cn/plugin?id=9107