uniapp存入通讯录
时间: 2023-09-18 10:10:57 浏览: 142
你可以使用uni-app提供的uni.addPhoneContact()方法将联系人信息存入手机通讯录。该方法接受一个包含联系人信息的对象作为参数,例如:
```javascript
uni.addPhoneContact({
firstName: '张',
lastName: '三',
middleName: '无',
mobilePhoneNumber: '13800138000',
workPhoneNumber: '010-12345678',
email: 'zhangsan@example.com',
organization: 'XX公司',
title: '开发工程师',
workAddressStreet: 'XX路XX号',
workAddressCity: '北京',
workAddressState: '北京',
workAddressPostalCode: '100000',
workAddressCountry: '中国',
remark: '备注信息'
});
```
其中,firstName和lastName分别表示联系人的姓和名,mobilePhoneNumber和workPhoneNumber分别表示联系人的移动电话和工作电话,email表示联系人的电子邮件地址,organization和title分别表示联系人的工作单位和职位,workAddressStreet、workAddressCity、workAddressState、workAddressPostalCode和workAddressCountry分别表示联系人的工作地址的街道、城市、省/州、邮编和国家/地区,remark表示备注信息。你可以根据实际情况传入需要的属性。
注意,该方法只能在APP端调用,无法在H5页面中使用。
阅读全文
相关推荐















