Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat small program API-device-mobile contacts


May 19, 2021 WeChat Mini Program Development Document


Table of contents


wx.addPhoneContact(OBJECT)

Base library 1.2.0 starts to support, and low versions need to be compatible

After the call, the user can choose to write the form to the phone system address book in the form of "New Contacts" or "Add to Existing Contacts" to complete the increase in contacts and contact information for the mobile phone contacts.

OBJECT parameter description:

Parameters Type Required Description
photoFilePath String Whether The avatar is the local file path
nickName String Whether Nickname
lastName String Whether Surname
middleName String Whether The middle name
firstName String Is Name
remark String Whether Note
mobilePhoneNumber String Whether Mobile phone number
weChatNumber String Whether microscopy
addressCountry String Whether Contact address country
addressState String Whether Contact address province
addressCity String Whether Contact address city
addressStreet String Whether Contact address street
addressPostalCode String Whether Contact address zip code
organization String Whether Company
title String Whether Position
workFaxNumber String Whether Work fax
workPhoneNumber String Whether Work phone
hostNumber String Whether Company phone number
email String no e-mail
url String no website
workAddressCountry String no Work address country
workAddressState String no Work address province
workAddressCity String no Work address city
workAddressStreet String no Work address street
workAddressPostalCode String no Work address Postal Code
homeFaxNumber String no Residential fax
homePhoneNumber String no residence phone
homeAddressCountry String no Residential address country
homeAddressState String no Residential address province
homeAddressCity String no Residential address city
homeAddressStreet String no Residential address street
homeAddressPostalCode String no Residential address Postal Code
success Function no Interface call success
fail Function no Interface call failed callback function
complete Function Whether Callback function at end of interface call (call succeeds, fails are executed)

Callback results:

The type of callback errMsg Description
success Ok The addition was successful
fail fail cancel The user cancels the operation
fail fail ${detail} The call failed, detail plus details