Cordova Open Native联系方式页面



是否可以检索和存储与Cordova本机通讯录中的联系人的引用并打开本地联系人详细信息页面?

Contacts-Plugin似乎没有提供任何有用的方法。

  1. 添加插件" org.apache.cordova.contacts"来自命令提示
  2. 使用Java脚本:

function onSuccess(contacts) {
  alert('Found ' + contacts.length + ' contacts.');
};
function onError(contactError) {
  alert('onError!');
};
// find all contacts with 'Bob' in any name field
var options = new ContactFindOptions();
options.filter = "Bob";
options.multiple = true;
options.desiredFields = [navigator.contacts.fieldType.id];
var fields = [navigator.contacts.fieldType.displayName, navigator.contacts.fieldType.name];
navigator.contacts.find(fields, onSuccess, onError, options);

,您也可以从成功功能中存储。

有关更多信息,请http://plugins.cordova.io/#/package/org.apache.cordova.contacts

最新更新