addContact
Opens the contacts of the user's device and shows a pre-filled "add new contact" view with the provided data. Depending on the operating system and its version, this could manifest as just an in-app overlay or a complete switch to the contacts app.
note
On Android, this uses an intent mechanism and therefor does not require additional permissions, while on Apple devices, the user is prompted to allow access to the contacts on first execution. See requestPermission to manually request permission beforehand.
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" (required) | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"city" | String | City of the contact's address. | null |
"company" | String | Company of the contact. | null |
"country" | String | Country of the contact's address. | null |
"email" | String | Email address of the contact. | null |
"emailWork" | String | Work email address of the contact. | null |
"familyName" | String | Family name of the contact. | null |
"givenName" | String | Given name of the contact. | null |
"imageUrl" | String | URL to the image of the contact. | null |
"jobTitle" | String | Job title of the contact. | null |
"phone" | String | Phone number of the contact. | null |
"phoneWork" | String | Work phone number of the contact. | null |
"postal" | String | Postal code of the contact's address. | null |
"street" | String | Street of the contact's address. | null |
"zip" | String | ZIP code of the contact's address. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Add a contact
Goal: Add a contact stating the company and the job title.
To achieve this the following code can be used:
{
"type": "addContact",
"params": {
"givenName": "John",
"familyName": "Smith",
"email": "smith@smiths.com",
"phone": "+492342232343",
"company": "Smith & Smith",
"jobTitle": "lawyer"
}
}
The params correspond to the information that is entered for the contact.
Result:
An addContact action has been created.