Démarrage
Copiez un prompt de configuration avec les étapes d'installation et la guide markdown complète pour ce plugin.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-contacts`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/contacts/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Installer
Section intitulée “Installer”bun add @capgo/capacitor-contactsbunx cap syncImporter
Section intitulée « Import »import { CapacitorContacts } from '@capgo/capacitor-contacts';API Vue d'ensemble
Section intitulée « API Vue d'ensemble »countContacts
Section intitulée « countContacts »Compter le nombre total de contacts sur le dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();createContact
Section intitulée « createContact »Créer un nouveau contact de manière programmée.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createContact({} as CreateContactOptions);createGroup
Section intitulée « createGroup »Créer un nouveau groupe de contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createGroup({} as CreateGroupOptions);deleteContactById
Section intitulée “deleteContactById”Supprimer un contact par ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);deleteGroupById
Section intitulée “deleteGroupById”Supprimer un groupe par ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({} as DeleteGroupByIdOptions);displayContactById
Section intitulée “displayContactById”Afficher un contact à l'aide du visionneuse de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);displayCreateContact
Section intitulée “displayCreateContact”Afficher l'interface utilisateur de création de contact natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();displayUpdateContactById
Section intitulée “displayUpdateContactById”Afficher l'interface utilisateur native de mise à jour de contact pour un contact spécifique.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({} as DisplayUpdateContactByIdOptions);getAccounts
Section intitulée “getAccounts”Récupérer tous les comptes disponibles sur le dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getAccounts();getContactById
Section intitulée “getContactById”Récupérer un contact spécifique par ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContactById({} as GetContactByIdOptions);getContacts
Section intitulée “getContacts”Récupérer tous les contacts du dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();getGroupById
Section intitulée “getGroupById”Récupérer un groupe spécifique par son ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroupById({} as GetGroupByIdOptions);getGroups
Section intitulée “getGroups”Récupérer tous les groupes de contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();isAvailable
Section intitulée “isAvailable”Vérifier si les contacts sont disponibles sur le dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();isSupported
Section intitulée “isSupported”Vérifier si le plugin est pris en charge sur la plateforme actuelle.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();openSettings
Section intitulée “openSettings”Ouvrez les paramètres de contacts du dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
Section intitulée “pickContact”Sélectionnez un contact unique à l'aide du pickeur de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();pickContacts
Section intitulée “pickContacts”Sélectionnez un ou plusieurs contacts à l'aide du pickeur de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();updateContactById
Section intitulée “updateContactById”Met à jour un contact existant en fonction de son ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);checkPermissions
Section intitulée “vérifier les permissions”Vérifiez l'état actuel des autorisations pour les contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();requestPermissions
Section intitulée “demander des autorisations”Demander des autorisations pour accéder aux contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.requestPermissions();Référence de type
Section intitulée “Référence de type”CountContactsResult
Section intitulée “Résultat du comptage des contacts”Résultat du comptage des contacts.
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
Section intitulée « Options de création de contact »Options pour créer un contact.
export interface CreateContactOptions { /** * Contact information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ contact: Omit<Contact, 'id'>;}CreateContactResult
Section intitulée « Résultat de création de contact »Résultat de la création d'un contact.
export interface CreateContactResult { /** * The ID of the newly created contact. * * @since 1.0.0 */ id: string;}CreateGroupOptions
Section intitulée « Options de création de groupe »Options pour créer un groupe.
export interface CreateGroupOptions { /** * Group information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ group: Omit<Group, 'id'>;}CreateGroupResult
Section intitulée « Résultat de création de groupe »Résultat de la création d'un groupe.
export interface CreateGroupResult { /** * The ID of the newly created group. * * @since 1.0.0 */ id: string;}DeleteContactByIdOptions
Section intitulée “Options de suppression d'un contact par ID”Options pour supprimer un contact par ID.
export interface DeleteContactByIdOptions { /** * The ID of the contact to delete. * * @since 1.0.0 */ id: string;}DeleteGroupByIdOptions
Section intitulée “Options de suppression d'un groupe par ID”Options pour supprimer un groupe par ID.
export interface DeleteGroupByIdOptions { /** * The ID of the group to delete. * * @since 1.0.0 */ id: string;}DisplayContactByIdOptions
Section intitulée “Options de visualisation d'un contact par ID”Options pour afficher un contact par ID.
export interface DisplayContactByIdOptions { /** * The ID of the contact to display. * * @since 1.0.0 */ id: string;}DisplayCreateContactOptions
Section intitulée “Options de visualisation de la création d'un contact”Options pour afficher l'interface utilisateur native de création de contact.
export interface DisplayCreateContactOptions { /** * Optional pre-filled contact information for the create UI. * * @since 1.0.0 */ contact?: Omit<Contact, 'id'>;}DisplayCreateContactResult
Section intitulée “DisplayCreateContactResult”Résultat de l'affichage de l'interface utilisateur native de création de contact.
export interface DisplayCreateContactResult { /** * The ID of the created contact, if one was created. Undefined if the user cancelled. * * @since 1.0.0 */ id?: string;}DisplayUpdateContactByIdOptions
Section intitulée “DisplayUpdateContactByIdOptions”Options pour afficher l'interface utilisateur native de mise à jour de contact.
export interface DisplayUpdateContactByIdOptions { /** * The ID of the contact to update. * * @since 1.0.0 */ id: string;}GetAccountsResult
Section intitulée “GetAccountsResult”Résultat de la récupération des comptes.
export interface GetAccountsResult { /** * List of accounts available on the device. * * @since 1.0.0 */ accounts: Account[];}Source De Vérité
Section intitulée “Source Of Truth”Cette page est générée à partir du plugin’s src/definitions.ts. Re-run la synchronisation lorsque le public API change en amont.
Continuez de l'étape de démarrage
Titre de la section « Continuez de l'étape de démarrage »Si vous utilisez Démarrage pour planifier le tableau de bord et les opérations de API, connectez-le à Utilisation de @capgo/capacitor-contacts pour la capacité native dans Utilisation de @capgo/capacitor-contacts, API Vue d'ensemble pour le détail d'implémentation dans API Vue d'ensemble, Introduction pour le détail d'implémentation dans Introduction, API Clés pour les détails d'implémentation dans API Clés, et Appareils pour les détails d'implémentation dans Appareils.