cordvoa 调取本地通讯录

1.安装插件:
cordova plugin add cordova-plugin-contacts
2.直接使用:
$scope.calltellphone = function(){
navigator.contacts.pickContact(function(contact){
alert(‘The following contact has been selected:’ + JSON.stringify(contact));
},function(err){
alert(‘Error: ’ + err);
});
}
3.获取到的内容 (常用)

var contact = {
            displayName:"",
            phoneumbers:[{
                value:"",type:"mobile"},{
                value:"",type:""}],
            emails:[{value:"",  type:"home"},{value:"",type:""  }]  ,
            addresses:''
 }

你可能感兴趣的:(cordova-插件)