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.
Type
(option: Option) => Promise<CallbackResult>
Parameters
Option
| Property | Type | Required | Description |
|---|---|---|---|
| firstName | string | Yes | Name |
| middleName | string | No | Middle name |
| lastName | string | No | Last name |
| nickName | string | No | Nickname |
| addressCity | string | No | Contact address city |
| addressCountry | string | No | Contact address country |
| addressPostalCode | string | No | Contact address post code |
| addressState | string | No | Contact address province |
| addressStreet | string | No | Contact address street |
string | No | Email address | |
| homeAddressCity | string | No | Home address city |
| homeAddressCountry | string | No | Home address county |
| homeAddressPostalCode | string | No | Home address post code |
| homeAddressState | string | No | Home address province |
| homeAddressStreet | string | No | Home address street |
| homeFaxNumber | string | No | Home fax |
| homePhoneNumber | string | No | Home phone number |
| hostNumber | string | No | Company phone number |
| mobilePhoneNumber | string | No | Mobile number |
| organization | string | No | Company |
| photoFilePath | string | No | Path of the local profile photo file |
| remark | string | No | Remarks |
| title | string | No | Job title |
| url | string | No | Website |
| weChatNumber | string | No | WeChat ID |
| workAddressCity | string | No | Work address city |
| workAddressCountry | string | No | Work address country |
| workAddressPostalCode | string | No | Work address post code |
| workAddressState | string | No | Work address province |
| workAddressStreet | string | No | Work address street |
| workFaxNumber | string | No | Work fax |
| workPhoneNumber | string | No | Work phone number |
| complete | (res: any) => void | No | The callback function used when the API call completed (always executed whether the call succeeds or fails) |
| fail | (res: any) => void | No | The callback function for a failed API call |
| success | (res: Result) => void | No | The callback function for a successful API call |
API Support
| API | WeChat Mini-Program | H5 | React Native |
|---|---|---|---|
| Taro.addPhoneContact | ✔️ |