@capgo/capacitor-contacts 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,884 @@
1
+ # @capgo/capacitor-contacts
2
+ <a href="https://capgo.app/"><img src='https://raw.githubusercontent.com/Cap-go/capgo/main/assets/capgo_banner.png' alt='Capgo - Instant updates for capacitor'/></a>
3
+
4
+ <div align="center">
5
+ <h2><a href="https://capgo.app/?ref=plugin"> ➡️ Get Instant updates for your App with Capgo</a></h2>
6
+ <h2><a href="https://capgo.app/consulting/?ref=plugin"> Missing a feature? We’ll build the plugin for you 💪</a></h2>
7
+ </div>
8
+
9
+
10
+ Manage device contacts across iOS, Android, and the Web with a unified Capacitor API.
11
+
12
+ WIP: the plugin is not yet ready for production
13
+
14
+ ## Documentation
15
+
16
+ The most complete doc is available here: https://capgo.app/docs/plugins/contacts/
17
+
18
+ ## Install
19
+
20
+ ```bash
21
+ npm install @capgo/capacitor-contacts
22
+ npx cap sync
23
+ ```
24
+
25
+ ## API
26
+
27
+ <docgen-index>
28
+
29
+ * [`countContacts()`](#countcontacts)
30
+ * [`createContact(...)`](#createcontact)
31
+ * [`createGroup(...)`](#creategroup)
32
+ * [`deleteContactById(...)`](#deletecontactbyid)
33
+ * [`deleteGroupById(...)`](#deletegroupbyid)
34
+ * [`displayContactById(...)`](#displaycontactbyid)
35
+ * [`displayCreateContact(...)`](#displaycreatecontact)
36
+ * [`displayUpdateContactById(...)`](#displayupdatecontactbyid)
37
+ * [`getAccounts()`](#getaccounts)
38
+ * [`getContactById(...)`](#getcontactbyid)
39
+ * [`getContacts(...)`](#getcontacts)
40
+ * [`getGroupById(...)`](#getgroupbyid)
41
+ * [`getGroups()`](#getgroups)
42
+ * [`isAvailable()`](#isavailable)
43
+ * [`isSupported()`](#issupported)
44
+ * [`openSettings()`](#opensettings)
45
+ * [`pickContact(...)`](#pickcontact)
46
+ * [`pickContacts(...)`](#pickcontacts)
47
+ * [`updateContactById(...)`](#updatecontactbyid)
48
+ * [`checkPermissions()`](#checkpermissions)
49
+ * [`requestPermissions(...)`](#requestpermissions)
50
+ * [`getPluginVersion()`](#getpluginversion)
51
+ * [Interfaces](#interfaces)
52
+ * [Type Aliases](#type-aliases)
53
+
54
+ </docgen-index>
55
+
56
+ <docgen-api>
57
+ <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->
58
+
59
+ Capacitor Contacts Plugin interface for managing device contacts.
60
+
61
+ ### countContacts()
62
+
63
+ ```typescript
64
+ countContacts() => Promise<CountContactsResult>
65
+ ```
66
+
67
+ Count the total number of contacts on the device.
68
+
69
+ **Returns:** <code>Promise&lt;<a href="#countcontactsresult">CountContactsResult</a>&gt;</code>
70
+
71
+ **Since:** 1.0.0
72
+
73
+ --------------------
74
+
75
+
76
+ ### createContact(...)
77
+
78
+ ```typescript
79
+ createContact(options: CreateContactOptions) => Promise<CreateContactResult>
80
+ ```
81
+
82
+ Create a new contact programmatically.
83
+
84
+ | Param | Type | Description |
85
+ | ------------- | --------------------------------------------------------------------- | ----------------------------------- |
86
+ | **`options`** | <code><a href="#createcontactoptions">CreateContactOptions</a></code> | - The contact information to create |
87
+
88
+ **Returns:** <code>Promise&lt;<a href="#createcontactresult">CreateContactResult</a>&gt;</code>
89
+
90
+ **Since:** 1.0.0
91
+
92
+ --------------------
93
+
94
+
95
+ ### createGroup(...)
96
+
97
+ ```typescript
98
+ createGroup(options: CreateGroupOptions) => Promise<CreateGroupResult>
99
+ ```
100
+
101
+ Create a new contact group.
102
+
103
+ | Param | Type | Description |
104
+ | ------------- | ----------------------------------------------------------------- | --------------------------------- |
105
+ | **`options`** | <code><a href="#creategroupoptions">CreateGroupOptions</a></code> | - The group information to create |
106
+
107
+ **Returns:** <code>Promise&lt;<a href="#creategroupresult">CreateGroupResult</a>&gt;</code>
108
+
109
+ **Since:** 1.0.0
110
+
111
+ --------------------
112
+
113
+
114
+ ### deleteContactById(...)
115
+
116
+ ```typescript
117
+ deleteContactById(options: DeleteContactByIdOptions) => Promise<void>
118
+ ```
119
+
120
+ Delete a contact by ID.
121
+
122
+ | Param | Type | Description |
123
+ | ------------- | ----------------------------------------------------------------------------- | --------------------------------- |
124
+ | **`options`** | <code><a href="#deletecontactbyidoptions">DeleteContactByIdOptions</a></code> | - The ID of the contact to delete |
125
+
126
+ **Since:** 1.0.0
127
+
128
+ --------------------
129
+
130
+
131
+ ### deleteGroupById(...)
132
+
133
+ ```typescript
134
+ deleteGroupById(options: DeleteGroupByIdOptions) => Promise<void>
135
+ ```
136
+
137
+ Delete a group by ID.
138
+
139
+ | Param | Type | Description |
140
+ | ------------- | ------------------------------------------------------------------------- | ------------------------------- |
141
+ | **`options`** | <code><a href="#deletegroupbyidoptions">DeleteGroupByIdOptions</a></code> | - The ID of the group to delete |
142
+
143
+ **Since:** 1.0.0
144
+
145
+ --------------------
146
+
147
+
148
+ ### displayContactById(...)
149
+
150
+ ```typescript
151
+ displayContactById(options: DisplayContactByIdOptions) => Promise<void>
152
+ ```
153
+
154
+ Display a contact using the native contact viewer.
155
+
156
+ | Param | Type | Description |
157
+ | ------------- | ------------------------------------------------------------------------------- | ---------------------------------- |
158
+ | **`options`** | <code><a href="#displaycontactbyidoptions">DisplayContactByIdOptions</a></code> | - The ID of the contact to display |
159
+
160
+ **Since:** 1.0.0
161
+
162
+ --------------------
163
+
164
+
165
+ ### displayCreateContact(...)
166
+
167
+ ```typescript
168
+ displayCreateContact(options?: DisplayCreateContactOptions | undefined) => Promise<DisplayCreateContactResult>
169
+ ```
170
+
171
+ Display the native create contact UI.
172
+
173
+ | Param | Type | Description |
174
+ | ------------- | ----------------------------------------------------------------------------------- | ----------------------------------------- |
175
+ | **`options`** | <code><a href="#displaycreatecontactoptions">DisplayCreateContactOptions</a></code> | - Optional pre-filled contact information |
176
+
177
+ **Returns:** <code>Promise&lt;<a href="#displaycreatecontactresult">DisplayCreateContactResult</a>&gt;</code>
178
+
179
+ **Since:** 1.0.0
180
+
181
+ --------------------
182
+
183
+
184
+ ### displayUpdateContactById(...)
185
+
186
+ ```typescript
187
+ displayUpdateContactById(options: DisplayUpdateContactByIdOptions) => Promise<void>
188
+ ```
189
+
190
+ Display the native update contact UI for a specific contact.
191
+
192
+ | Param | Type | Description |
193
+ | ------------- | ------------------------------------------------------------------------------------------- | --------------------------------- |
194
+ | **`options`** | <code><a href="#displayupdatecontactbyidoptions">DisplayUpdateContactByIdOptions</a></code> | - The ID of the contact to update |
195
+
196
+ **Since:** 1.0.0
197
+
198
+ --------------------
199
+
200
+
201
+ ### getAccounts()
202
+
203
+ ```typescript
204
+ getAccounts() => Promise<GetAccountsResult>
205
+ ```
206
+
207
+ Get all accounts available on the device.
208
+
209
+ **Returns:** <code>Promise&lt;<a href="#getaccountsresult">GetAccountsResult</a>&gt;</code>
210
+
211
+ **Since:** 1.0.0
212
+
213
+ --------------------
214
+
215
+
216
+ ### getContactById(...)
217
+
218
+ ```typescript
219
+ getContactById(options: GetContactByIdOptions) => Promise<GetContactByIdResult>
220
+ ```
221
+
222
+ Get a specific contact by ID.
223
+
224
+ | Param | Type | Description |
225
+ | ------------- | ----------------------------------------------------------------------- | ---------------------------------------- |
226
+ | **`options`** | <code><a href="#getcontactbyidoptions">GetContactByIdOptions</a></code> | - The ID and optional fields to retrieve |
227
+
228
+ **Returns:** <code>Promise&lt;<a href="#getcontactbyidresult">GetContactByIdResult</a>&gt;</code>
229
+
230
+ **Since:** 1.0.0
231
+
232
+ --------------------
233
+
234
+
235
+ ### getContacts(...)
236
+
237
+ ```typescript
238
+ getContacts(options?: GetContactsOptions | undefined) => Promise<GetContactsResult>
239
+ ```
240
+
241
+ Get all contacts from the device.
242
+
243
+ | Param | Type | Description |
244
+ | ------------- | ----------------------------------------------------------------- | ----------------------------------------- |
245
+ | **`options`** | <code><a href="#getcontactsoptions">GetContactsOptions</a></code> | - Optional filters and pagination options |
246
+
247
+ **Returns:** <code>Promise&lt;<a href="#getcontactsresult">GetContactsResult</a>&gt;</code>
248
+
249
+ **Since:** 1.0.0
250
+
251
+ --------------------
252
+
253
+
254
+ ### getGroupById(...)
255
+
256
+ ```typescript
257
+ getGroupById(options: GetGroupByIdOptions) => Promise<GetGroupByIdResult>
258
+ ```
259
+
260
+ Get a specific group by ID.
261
+
262
+ | Param | Type | Description |
263
+ | ------------- | ------------------------------------------------------------------- | --------------------------------- |
264
+ | **`options`** | <code><a href="#getgroupbyidoptions">GetGroupByIdOptions</a></code> | - The ID of the group to retrieve |
265
+
266
+ **Returns:** <code>Promise&lt;<a href="#getgroupbyidresult">GetGroupByIdResult</a>&gt;</code>
267
+
268
+ **Since:** 1.0.0
269
+
270
+ --------------------
271
+
272
+
273
+ ### getGroups()
274
+
275
+ ```typescript
276
+ getGroups() => Promise<GetGroupsResult>
277
+ ```
278
+
279
+ Get all contact groups.
280
+
281
+ **Returns:** <code>Promise&lt;<a href="#getgroupsresult">GetGroupsResult</a>&gt;</code>
282
+
283
+ **Since:** 1.0.0
284
+
285
+ --------------------
286
+
287
+
288
+ ### isAvailable()
289
+
290
+ ```typescript
291
+ isAvailable() => Promise<IsAvailableResult>
292
+ ```
293
+
294
+ Check if contacts are available on the device.
295
+
296
+ **Returns:** <code>Promise&lt;<a href="#isavailableresult">IsAvailableResult</a>&gt;</code>
297
+
298
+ **Since:** 1.0.0
299
+
300
+ --------------------
301
+
302
+
303
+ ### isSupported()
304
+
305
+ ```typescript
306
+ isSupported() => Promise<IsSupportedResult>
307
+ ```
308
+
309
+ Check if the plugin is supported on the current platform.
310
+
311
+ **Returns:** <code>Promise&lt;<a href="#issupportedresult">IsSupportedResult</a>&gt;</code>
312
+
313
+ **Since:** 1.0.0
314
+
315
+ --------------------
316
+
317
+
318
+ ### openSettings()
319
+
320
+ ```typescript
321
+ openSettings() => Promise<void>
322
+ ```
323
+
324
+ Open the device's contacts settings.
325
+
326
+ **Since:** 1.0.0
327
+
328
+ --------------------
329
+
330
+
331
+ ### pickContact(...)
332
+
333
+ ```typescript
334
+ pickContact(options?: PickContactsOptions | undefined) => Promise<PickContactResult>
335
+ ```
336
+
337
+ <a href="#pick">Pick</a> a single contact using the native contact picker.
338
+
339
+ | Param | Type | Description |
340
+ | ------------- | ------------------------------------------------------------------- | ------------------------------------------------------ |
341
+ | **`options`** | <code><a href="#pickcontactsoptions">PickContactsOptions</a></code> | - Optional fields to retrieve and picker configuration |
342
+
343
+ **Returns:** <code>Promise&lt;<a href="#pickcontactsresult">PickContactsResult</a>&gt;</code>
344
+
345
+ **Since:** 1.0.0
346
+
347
+ --------------------
348
+
349
+
350
+ ### pickContacts(...)
351
+
352
+ ```typescript
353
+ pickContacts(options?: PickContactsOptions | undefined) => Promise<PickContactsResult>
354
+ ```
355
+
356
+ <a href="#pick">Pick</a> one or more contacts using the native contact picker.
357
+
358
+ | Param | Type | Description |
359
+ | ------------- | ------------------------------------------------------------------- | ------------------------------------------------------ |
360
+ | **`options`** | <code><a href="#pickcontactsoptions">PickContactsOptions</a></code> | - Optional fields to retrieve and picker configuration |
361
+
362
+ **Returns:** <code>Promise&lt;<a href="#pickcontactsresult">PickContactsResult</a>&gt;</code>
363
+
364
+ **Since:** 1.0.0
365
+
366
+ --------------------
367
+
368
+
369
+ ### updateContactById(...)
370
+
371
+ ```typescript
372
+ updateContactById(options: UpdateContactByIdOptions) => Promise<void>
373
+ ```
374
+
375
+ Update an existing contact by ID.
376
+
377
+ | Param | Type | Description |
378
+ | ------------- | ----------------------------------------------------------------------------- | ---------------------------------------- |
379
+ | **`options`** | <code><a href="#updatecontactbyidoptions">UpdateContactByIdOptions</a></code> | - The ID and updated contact information |
380
+
381
+ **Since:** 1.0.0
382
+
383
+ --------------------
384
+
385
+
386
+ ### checkPermissions()
387
+
388
+ ```typescript
389
+ checkPermissions() => Promise<PermissionStatus>
390
+ ```
391
+
392
+ Check the current permission status for contacts.
393
+
394
+ **Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>
395
+
396
+ **Since:** 1.0.0
397
+
398
+ --------------------
399
+
400
+
401
+ ### requestPermissions(...)
402
+
403
+ ```typescript
404
+ requestPermissions(options?: RequestPermissionsOptions | undefined) => Promise<PermissionStatus>
405
+ ```
406
+
407
+ Request permissions to access contacts.
408
+
409
+ | Param | Type | Description |
410
+ | ------------- | ------------------------------------------------------------------------------- | ------------------------------------------ |
411
+ | **`options`** | <code><a href="#requestpermissionsoptions">RequestPermissionsOptions</a></code> | - Optional specific permissions to request |
412
+
413
+ **Returns:** <code>Promise&lt;<a href="#permissionstatus">PermissionStatus</a>&gt;</code>
414
+
415
+ **Since:** 1.0.0
416
+
417
+ --------------------
418
+
419
+
420
+ ### getPluginVersion()
421
+
422
+ ```typescript
423
+ getPluginVersion() => Promise<{ version: string; }>
424
+ ```
425
+
426
+ Get the native Capacitor plugin version.
427
+
428
+ **Returns:** <code>Promise&lt;{ version: string; }&gt;</code>
429
+
430
+ **Since:** 1.0.0
431
+
432
+ --------------------
433
+
434
+
435
+ ### Interfaces
436
+
437
+
438
+ #### CountContactsResult
439
+
440
+ Result from counting contacts.
441
+
442
+ | Prop | Type | Description | Since |
443
+ | ----------- | ------------------- | ------------------------- | ----- |
444
+ | **`count`** | <code>number</code> | Total number of contacts. | 1.0.0 |
445
+
446
+
447
+ #### CreateContactResult
448
+
449
+ Result from creating a contact.
450
+
451
+ | Prop | Type | Description | Since |
452
+ | -------- | ------------------- | ------------------------------------ | ----- |
453
+ | **`id`** | <code>string</code> | The ID of the newly created contact. | 1.0.0 |
454
+
455
+
456
+ #### CreateContactOptions
457
+
458
+ Options for creating a contact.
459
+
460
+ | Prop | Type | Description | Since |
461
+ | ------------- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | ----- |
462
+ | **`contact`** | <code><a href="#omit">Omit</a>&lt;<a href="#contact">Contact</a>, 'id'&gt;</code> | <a href="#contact">Contact</a> information to create. The 'id' field will be generated automatically. | 1.0.0 |
463
+
464
+
465
+ #### Contact
466
+
467
+ <a href="#contact">Contact</a> information.
468
+
469
+ | Prop | Type | Description | Since |
470
+ | ---------------------- | --------------------------------------------- | ------------------------------------------------------------- | ----- |
471
+ | **`id`** | <code>string</code> | Unique identifier for the contact. | 1.0.0 |
472
+ | **`account`** | <code><a href="#account">Account</a></code> | <a href="#account">Account</a> information for the contact. | 1.0.0 |
473
+ | **`birthday`** | <code><a href="#birthday">Birthday</a></code> | <a href="#birthday">Birthday</a> information for the contact. | 1.0.0 |
474
+ | **`emailAddresses`** | <code>EmailAddress[]</code> | Email addresses for the contact. | 1.0.0 |
475
+ | **`familyName`** | <code>string</code> | Family name (last name) of the contact. | 1.0.0 |
476
+ | **`fullName`** | <code>string</code> | Full name of the contact. | 1.0.0 |
477
+ | **`givenName`** | <code>string</code> | Given name (first name) of the contact. | 1.0.0 |
478
+ | **`groupIds`** | <code>string[]</code> | <a href="#group">Group</a> IDs the contact belongs to. | 1.0.0 |
479
+ | **`jobTitle`** | <code>string</code> | Job title of the contact. | 1.0.0 |
480
+ | **`middleName`** | <code>string</code> | Middle name of the contact. | 1.0.0 |
481
+ | **`namePrefix`** | <code>string</code> | Name prefix (e.g., "Dr.", "Mr.", "Ms.") of the contact. | 1.0.0 |
482
+ | **`nameSuffix`** | <code>string</code> | Name suffix (e.g., "Jr.", "Sr.", "III") of the contact. | 1.0.0 |
483
+ | **`note`** | <code>string</code> | Notes about the contact. | 1.0.0 |
484
+ | **`organizationName`** | <code>string</code> | Organization name of the contact. | 1.0.0 |
485
+ | **`phoneNumbers`** | <code>PhoneNumber[]</code> | Phone numbers for the contact. | 1.0.0 |
486
+ | **`photo`** | <code>string</code> | Base64-encoded photo of the contact. | 1.0.0 |
487
+ | **`postalAddresses`** | <code>PostalAddress[]</code> | Postal addresses for the contact. | 1.0.0 |
488
+ | **`urlAddresses`** | <code>UrlAddress[]</code> | URL addresses for the contact. | 1.0.0 |
489
+
490
+
491
+ #### Account
492
+
493
+ <a href="#account">Account</a> information for a contact.
494
+
495
+ | Prop | Type | Description | Since |
496
+ | ---------- | ------------------- | ------------------------ | ----- |
497
+ | **`name`** | <code>string</code> | The name of the account. | 1.0.0 |
498
+ | **`type`** | <code>string</code> | The type of the account. | 1.0.0 |
499
+
500
+
501
+ #### Birthday
502
+
503
+ <a href="#birthday">Birthday</a> information for a contact.
504
+
505
+ | Prop | Type | Description | Since |
506
+ | ----------- | ------------------- | ---------------------------- | ----- |
507
+ | **`day`** | <code>number</code> | The day of the month (1-31). | 1.0.0 |
508
+ | **`month`** | <code>number</code> | The month (1-12). | 1.0.0 |
509
+ | **`year`** | <code>number</code> | The year. | 1.0.0 |
510
+
511
+
512
+ #### EmailAddress
513
+
514
+ Email address information for a contact.
515
+
516
+ | Prop | Type | Description | Since |
517
+ | --------------- | ------------------------------------------------------------- | ------------------------------------------ | ----- |
518
+ | **`value`** | <code>string</code> | The email address value. | 1.0.0 |
519
+ | **`type`** | <code><a href="#emailaddresstype">EmailAddressType</a></code> | The type of email address. | 1.0.0 |
520
+ | **`label`** | <code>string</code> | Custom label for the email address. | 1.0.0 |
521
+ | **`isPrimary`** | <code>boolean</code> | Whether this is the primary email address. | 1.0.0 |
522
+
523
+
524
+ #### PhoneNumber
525
+
526
+ Phone number information for a contact.
527
+
528
+ | Prop | Type | Description | Since |
529
+ | --------------- | ----------------------------------------------------------- | ----------------------------------------- | ----- |
530
+ | **`value`** | <code>string</code> | The phone number value. | 1.0.0 |
531
+ | **`type`** | <code><a href="#phonenumbertype">PhoneNumberType</a></code> | The type of phone number. | 1.0.0 |
532
+ | **`label`** | <code>string</code> | Custom label for the phone number. | 1.0.0 |
533
+ | **`isPrimary`** | <code>boolean</code> | Whether this is the primary phone number. | 1.0.0 |
534
+
535
+
536
+ #### PostalAddress
537
+
538
+ Postal address information for a contact.
539
+
540
+ | Prop | Type | Description | Since |
541
+ | -------------------- | --------------------------------------------------------------- | ------------------------------------------- | ----- |
542
+ | **`city`** | <code>string</code> | The city name. | 1.0.0 |
543
+ | **`country`** | <code>string</code> | The country name. | 1.0.0 |
544
+ | **`formatted`** | <code>string</code> | The formatted address string. | 1.0.0 |
545
+ | **`isoCountryCode`** | <code>string</code> | The ISO country code. | 1.0.0 |
546
+ | **`isPrimary`** | <code>boolean</code> | Whether this is the primary postal address. | 1.0.0 |
547
+ | **`label`** | <code>string</code> | Custom label for the postal address. | 1.0.0 |
548
+ | **`neighborhood`** | <code>string</code> | The neighborhood name. | 1.0.0 |
549
+ | **`postalCode`** | <code>string</code> | The postal code. | 1.0.0 |
550
+ | **`state`** | <code>string</code> | The state or province name. | 1.0.0 |
551
+ | **`street`** | <code>string</code> | The street address. | 1.0.0 |
552
+ | **`type`** | <code><a href="#postaladdresstype">PostalAddressType</a></code> | The type of postal address. | 1.0.0 |
553
+
554
+
555
+ #### UrlAddress
556
+
557
+ URL address information for a contact.
558
+
559
+ | Prop | Type | Description | Since |
560
+ | ----------- | --------------------------------------------------------- | ------------------------- | ----- |
561
+ | **`value`** | <code>string</code> | The URL value. | 1.0.0 |
562
+ | **`type`** | <code><a href="#urladdresstype">UrlAddressType</a></code> | The type of URL. | 1.0.0 |
563
+ | **`label`** | <code>string</code> | Custom label for the URL. | 1.0.0 |
564
+
565
+
566
+ #### CreateGroupResult
567
+
568
+ Result from creating a group.
569
+
570
+ | Prop | Type | Description | Since |
571
+ | -------- | ------------------- | ---------------------------------- | ----- |
572
+ | **`id`** | <code>string</code> | The ID of the newly created group. | 1.0.0 |
573
+
574
+
575
+ #### CreateGroupOptions
576
+
577
+ Options for creating a group.
578
+
579
+ | Prop | Type | Description | Since |
580
+ | ----------- | ----------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ----- |
581
+ | **`group`** | <code><a href="#omit">Omit</a>&lt;<a href="#group">Group</a>, 'id'&gt;</code> | <a href="#group">Group</a> information to create. The 'id' field will be generated automatically. | 1.0.0 |
582
+
583
+
584
+ #### Group
585
+
586
+ <a href="#contact">Contact</a> group information.
587
+
588
+ | Prop | Type | Description | Since |
589
+ | ---------- | ------------------- | -------------------------------- | ----- |
590
+ | **`id`** | <code>string</code> | Unique identifier for the group. | 1.0.0 |
591
+ | **`name`** | <code>string</code> | Name of the group. | 1.0.0 |
592
+
593
+
594
+ #### DeleteContactByIdOptions
595
+
596
+ Options for deleting a contact by ID.
597
+
598
+ | Prop | Type | Description | Since |
599
+ | -------- | ------------------- | -------------------------------- | ----- |
600
+ | **`id`** | <code>string</code> | The ID of the contact to delete. | 1.0.0 |
601
+
602
+
603
+ #### DeleteGroupByIdOptions
604
+
605
+ Options for deleting a group by ID.
606
+
607
+ | Prop | Type | Description | Since |
608
+ | -------- | ------------------- | ------------------------------ | ----- |
609
+ | **`id`** | <code>string</code> | The ID of the group to delete. | 1.0.0 |
610
+
611
+
612
+ #### DisplayContactByIdOptions
613
+
614
+ Options for displaying a contact by ID.
615
+
616
+ | Prop | Type | Description | Since |
617
+ | -------- | ------------------- | --------------------------------- | ----- |
618
+ | **`id`** | <code>string</code> | The ID of the contact to display. | 1.0.0 |
619
+
620
+
621
+ #### DisplayCreateContactResult
622
+
623
+ Result from displaying the native create contact UI.
624
+
625
+ | Prop | Type | Description | Since |
626
+ | -------- | ------------------- | ----------------------------------------------------------------------------------- | ----- |
627
+ | **`id`** | <code>string</code> | The ID of the created contact, if one was created. Undefined if the user cancelled. | 1.0.0 |
628
+
629
+
630
+ #### DisplayCreateContactOptions
631
+
632
+ Options for displaying the native create contact UI.
633
+
634
+ | Prop | Type | Description | Since |
635
+ | ------------- | --------------------------------------------------------------------------------- | ---------------------------------------------------------- | ----- |
636
+ | **`contact`** | <code><a href="#omit">Omit</a>&lt;<a href="#contact">Contact</a>, 'id'&gt;</code> | Optional pre-filled contact information for the create UI. | 1.0.0 |
637
+
638
+
639
+ #### DisplayUpdateContactByIdOptions
640
+
641
+ Options for displaying the native update contact UI.
642
+
643
+ | Prop | Type | Description | Since |
644
+ | -------- | ------------------- | -------------------------------- | ----- |
645
+ | **`id`** | <code>string</code> | The ID of the contact to update. | 1.0.0 |
646
+
647
+
648
+ #### GetAccountsResult
649
+
650
+ Result from getting accounts.
651
+
652
+ | Prop | Type | Description | Since |
653
+ | -------------- | ---------------------- | ----------------------------------------- | ----- |
654
+ | **`accounts`** | <code>Account[]</code> | List of accounts available on the device. | 1.0.0 |
655
+
656
+
657
+ #### GetContactByIdResult
658
+
659
+ Result from getting a contact by ID.
660
+
661
+ | Prop | Type | Description | Since |
662
+ | ------------- | --------------------------------------------------- | ---------------------------------- | ----- |
663
+ | **`contact`** | <code><a href="#contact">Contact</a> \| null</code> | The contact, or null if not found. | 1.0.0 |
664
+
665
+
666
+ #### GetContactByIdOptions
667
+
668
+ Options for getting a contact by ID.
669
+
670
+ | Prop | Type | Description | Since |
671
+ | ------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------- | ----- |
672
+ | **`id`** | <code>string</code> | The ID of the contact to retrieve. | 1.0.0 |
673
+ | **`fields`** | <code>(keyof <a href="#contact">Contact</a>)[]</code> | Optional list of specific fields to retrieve. If not specified, all fields are returned. | 1.0.0 |
674
+
675
+
676
+ #### GetContactsResult
677
+
678
+ Result from getting contacts.
679
+
680
+ | Prop | Type | Description | Since |
681
+ | -------------- | ---------------------- | ----------------- | ----- |
682
+ | **`contacts`** | <code>Contact[]</code> | List of contacts. | 1.0.0 |
683
+
684
+
685
+ #### GetContactsOptions
686
+
687
+ Options for getting contacts.
688
+
689
+ | Prop | Type | Description | Since |
690
+ | ------------ | ----------------------------------------------------- | ---------------------------------------------------------------------------------------- | ----- |
691
+ | **`fields`** | <code>(keyof <a href="#contact">Contact</a>)[]</code> | Optional list of specific fields to retrieve. If not specified, all fields are returned. | 1.0.0 |
692
+ | **`limit`** | <code>number</code> | Maximum number of contacts to return. | 1.0.0 |
693
+ | **`offset`** | <code>number</code> | Number of contacts to skip before starting to return results. | 1.0.0 |
694
+
695
+
696
+ #### GetGroupByIdResult
697
+
698
+ Result from getting a group by ID.
699
+
700
+ | Prop | Type | Description | Since |
701
+ | ----------- | ----------------------------------------------- | -------------------------------- | ----- |
702
+ | **`group`** | <code><a href="#group">Group</a> \| null</code> | The group, or null if not found. | 1.0.0 |
703
+
704
+
705
+ #### GetGroupByIdOptions
706
+
707
+ Options for getting a group by ID.
708
+
709
+ | Prop | Type | Description | Since |
710
+ | -------- | ------------------- | -------------------------------- | ----- |
711
+ | **`id`** | <code>string</code> | The ID of the group to retrieve. | 1.0.0 |
712
+
713
+
714
+ #### GetGroupsResult
715
+
716
+ Result from getting groups.
717
+
718
+ | Prop | Type | Description | Since |
719
+ | ------------ | -------------------- | --------------- | ----- |
720
+ | **`groups`** | <code>Group[]</code> | List of groups. | 1.0.0 |
721
+
722
+
723
+ #### IsAvailableResult
724
+
725
+ Result from checking if contacts are available on the device.
726
+
727
+ | Prop | Type | Description | Since |
728
+ | ----------------- | -------------------- | ---------------------------------------------- | ----- |
729
+ | **`isAvailable`** | <code>boolean</code> | Whether contacts are available on this device. | 1.0.0 |
730
+
731
+
732
+ #### IsSupportedResult
733
+
734
+ Result from checking if the plugin is supported on the platform.
735
+
736
+ | Prop | Type | Description | Since |
737
+ | ----------------- | -------------------- | ------------------------------------------------- | ----- |
738
+ | **`isSupported`** | <code>boolean</code> | Whether the plugin is supported on this platform. | 1.0.0 |
739
+
740
+
741
+ #### PickContactsResult
742
+
743
+ Result from picking contacts.
744
+
745
+ | Prop | Type | Description | Since |
746
+ | -------------- | ---------------------- | -------------------------- | ----- |
747
+ | **`contacts`** | <code>Contact[]</code> | List of selected contacts. | 1.0.0 |
748
+
749
+
750
+ #### PickContactsOptions
751
+
752
+ Options for picking contacts using the native contact picker.
753
+
754
+ | Prop | Type | Description | Since |
755
+ | -------------- | ----------------------------------------------------- | ---------------------------------------------------------------------------------------- | ----- |
756
+ | **`fields`** | <code>(keyof <a href="#contact">Contact</a>)[]</code> | Optional list of specific fields to retrieve. If not specified, all fields are returned. | 1.0.0 |
757
+ | **`multiple`** | <code>boolean</code> | Whether to allow selecting multiple contacts. Default is false. | 1.0.0 |
758
+
759
+
760
+ #### UpdateContactByIdOptions
761
+
762
+ Options for updating a contact by ID.
763
+
764
+ | Prop | Type | Description | Since |
765
+ | ------------- | --------------------------------------------------------------------------------- | -------------------------------- | ----- |
766
+ | **`id`** | <code>string</code> | The ID of the contact to update. | 1.0.0 |
767
+ | **`contact`** | <code><a href="#omit">Omit</a>&lt;<a href="#contact">Contact</a>, 'id'&gt;</code> | Updated contact information. | 1.0.0 |
768
+
769
+
770
+ #### PermissionStatus
771
+
772
+ Status of contacts permissions.
773
+
774
+ | Prop | Type | Description | Since |
775
+ | ------------------- | --------------------------------------------------------------------------- | -------------------------------------- | ----- |
776
+ | **`readContacts`** | <code><a href="#contactspermissionstate">ContactsPermissionState</a></code> | Permission state for reading contacts. | 1.0.0 |
777
+ | **`writeContacts`** | <code><a href="#contactspermissionstate">ContactsPermissionState</a></code> | Permission state for writing contacts. | 1.0.0 |
778
+
779
+
780
+ #### RequestPermissionsOptions
781
+
782
+ Options for requesting contacts permissions.
783
+
784
+ | Prop | Type | Description | Since |
785
+ | ----------------- | ------------------------------------- | ------------------------------------------------------------------------------------ | ----- |
786
+ | **`permissions`** | <code>ContactsPermissionType[]</code> | Specific permissions to request. If not provided, all permissions will be requested. | 1.0.0 |
787
+
788
+
789
+ ### Type Aliases
790
+
791
+
792
+ #### Omit
793
+
794
+ Construct a type with the properties of T except for those in type K.
795
+
796
+ <code><a href="#pick">Pick</a>&lt;T, <a href="#exclude">Exclude</a>&lt;keyof T, K&gt;&gt;</code>
797
+
798
+
799
+ #### Pick
800
+
801
+ From T, pick a set of properties whose keys are in the union K
802
+
803
+ <code>{
804
  [P in K]: T[P];
1
805
  }</code>
806
+
807
+
808
+ #### Exclude
809
+
810
+ <a href="#exclude">Exclude</a> from T those types that are assignable to U
811
+
812
+ <code>T extends U ? never : T</code>
813
+
814
+
815
+ #### EmailAddressType
816
+
817
+ Type of email address.
818
+
819
+ <code>'CUSTOM' | 'HOME' | 'ICLOUD' | 'OTHER' | 'WORK'</code>
820
+
821
+
822
+ #### PhoneNumberType
823
+
824
+ Type of phone number.
825
+
826
+ <code>'ASSISTANT' | 'CALLBACK' | 'CAR' | 'COMPANY_MAIN' | 'CUSTOM' | 'FAX_HOME' | 'FAX_WORK' | 'HOME' | 'HOME_FAX' | 'ISDN' | 'MAIN' | 'MMS' | 'MOBILE' | 'OTHER' | 'OTHER_FAX' | 'PAGER' | 'RADIO' | 'TELEX' | 'TTY_TDD' | 'WORK' | 'WORK_MOBILE' | 'WORK_PAGER'</code>
827
+
828
+
829
+ #### PostalAddressType
830
+
831
+ Type of postal address.
832
+
833
+ <code>'CUSTOM' | 'HOME' | 'OTHER' | 'WORK'</code>
834
+
835
+
836
+ #### UrlAddressType
837
+
838
+ Type of URL address.
839
+
840
+ <code>'BLOG' | 'CUSTOM' | 'FTP' | 'HOME' | 'HOMEPAGE' | 'OTHER' | 'PROFILE' | 'SCHOOL' | 'WORK'</code>
841
+
842
+
843
+ #### ContactField
844
+
845
+ Field names available in a <a href="#contact">Contact</a> object.
846
+
847
+ <code>keyof <a href="#contact">Contact</a></code>
848
+
849
+
850
+ #### PickContactOptions
851
+
852
+ Alias for <a href="#pickcontactsoptions">PickContactsOptions</a>.
853
+
854
+ <code><a href="#pickcontactsoptions">PickContactsOptions</a></code>
855
+
856
+
857
+ #### PickContactResult
858
+
859
+ Alias for <a href="#pickcontactsresult">PickContactsResult</a>.
860
+
861
+ <code><a href="#pickcontactsresult">PickContactsResult</a></code>
862
+
863
+
864
+ #### ContactsPermissionState
865
+
866
+ Permission state for contacts access, including the 'limited' state for iOS 18+.
867
+
868
+ <code><a href="#permissionstate">PermissionState</a> | 'limited'</code>
869
+
870
+
871
+ #### PermissionState
872
+
873
+ <code>'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'</code>
874
+
875
+
876
+ #### ContactsPermissionType
877
+
878
+ Type of contacts permission to request.
879
+
880
+ <code>'readContacts' | 'writeContacts'</code>
881
+
882
+ </docgen-api>
883
+
884
+ ### Credit
885
+
886
+ This plugin was inspired from: https://github.com/kesha-antonov/react-native-background-downloader