1.首先在微信公众平台后台配置隐私协议,
2.配置完成后并更新协议
3.前端代码
(这里面确保的你的firstName有值,安卓必须有firstName,苹果的话有nickName就能调起但是安卓不可以,所以还是确保有firstName)
//加入通讯录
addphone() {
// this.getAuthorize()
console.log(this.infos,'--------')
console.log(this.infos.name,'--------name')
var infos = this.infos;
uni.addPhoneContact({
// nickName:infos.name,
// lastName: '姓',
firstName: infos.name,
// remark: '备注',
mobilePhoneNumber: infos.phone, //手机号
// weChatNumber: 'wx123',
success: function() {
console.log('success');
},
fail: function(fail) {
console.log('fail',fail);
}
});
},