You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This method will return `false` if access to Contacts has not been granted.
128
+
129
+
### contacts.deleteContactByName(name)
130
+
131
+
*`name` String (required) - The first, last, or full name of a contact.
132
+
133
+
Returns `Boolean` - whether the contact was deleted successfully.
134
+
135
+
Deletes a contact to the user's contacts database.
136
+
137
+
If a contact's full name is 'Shelley Vohr', I could pass 'Shelley', 'Vohr', or 'Shelley Vohr' as `name`.
138
+
However, you should take care to specify `name` to such a degree that you can be confident the first contact to be returned from a predicate search is the contact you intend to delete.
139
+
140
+
```js
141
+
constname='Jonathan Appleseed'
142
+
constdeleted=contacts.deleteContactByName(name)
143
+
144
+
console.log(`Contact ${name} was ${deleted ?'deleted':'not deleted'}.`)
145
+
```
146
+
147
+
This method will return `false` if access to Contacts has not been granted.
0 commit comments