Skip to main content
Version: 3.x

Taro.addPhoneContact(option)

Adds a contact to the mobile contacts. The user can write this form to the mobile contacts using either "Add Contact" or "Add to Existing Contact" method.

Reference

Type

(option: Option) => Promise<CallbackResult>

Parameters

Option

PropertyTypeRequiredDescription
firstNamestringYesName
middleNamestringNoMiddle name
lastNamestringNoLast name
nickNamestringNoNickname
addressCitystringNoContact address city
addressCountrystringNoContact address country
addressPostalCodestringNoContact address post code
addressStatestringNoContact address province
addressStreetstringNoContact address street
emailstringNoEmail address
homeAddressCitystringNoHome address city
homeAddressCountrystringNoHome address county
homeAddressPostalCodestringNoHome address post code
homeAddressStatestringNoHome address province
homeAddressStreetstringNoHome address street
homeFaxNumberstringNoHome fax
homePhoneNumberstringNoHome phone number
hostNumberstringNoCompany phone number
mobilePhoneNumberstringNoMobile number
organizationstringNoCompany
photoFilePathstringNoPath of the local profile photo file
remarkstringNoRemarks
titlestringNoJob title
urlstringNoWebsite
weChatNumberstringNoWeChat ID
workAddressCitystringNoWork address city
workAddressCountrystringNoWork address country
workAddressPostalCodestringNoWork address post code
workAddressStatestringNoWork address province
workAddressStreetstringNoWork address street
workFaxNumberstringNoWork fax
workPhoneNumberstringNoWork phone number
complete(res: any) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: any) => voidNoThe callback function for a failed API call
success(res: Result) => voidNoThe callback function for a successful API call

API Support

APIWeChat Mini-ProgramH5React Native
Taro.addPhoneContact✔️