Démarrage
Copiez un prompt de configuration avec les étapes d'installation et le guide markdown complet 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
Sous-section intitulée « Installer »Vous pouvez utiliser notre installation assistée par l'IA pour installer le plugin. Ajoutez les Capgo compétences à votre outil IA en utilisant la commande suivante :
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsEnsuite, utilisez la prompt suivante :
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-contacts` plugin in my project.Si vous préférez l'installation manuelle, installez le plugin en exécutant les commandes suivantes et suivez les instructions spécifiques à la plateforme ci-dessous :
bun add @capgo/capacitor-contactsbunx cap syncImporter
Section intitulée « Importer »import { CapacitorContacts } from '@capgo/capacitor-contacts';API Aperçu
Section intitulée « API Aperçu »countContacts
Section intitulée « compterContacts »Compter le nombre total de contacts sur le dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();createContact
Section intitulée « créerContact »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 « créerGroupe »Créez 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 visionneur de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);displayCreateContact
Section intitulée “displayCreateContact”Afficher l'interface utilisateur native pour créer un contact.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();displayUpdateContactById
Section intitulée « displayUpdateContactById »Afficher l'interface utilisateur native pour mettre à jour 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érez tous les contacts du dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();getGroupById
Section intitulée “getGroupById”Récupérez 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érez tous les groupes de contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();isAvailable
Section intitulée “isAvailable”Vérifiez si les contacts sont disponibles sur le dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();isSupported
Section intitulée “isSupported”Vérifiez si le plugin est pris en charge sur la plateforme actuelle.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();openSettings
Section intitulée “Réglages ouverts”Ouvrez les paramètres de contacts du dispositif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
Section intitulée “Sélectionner un contact”Sélectionnez un contact unique à l'aide du sélectionneur de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();Sélectionnez un ou plusieurs contacts à l'aide du sélectionneur de contacts natif.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();updateContactById
Section intitulée “Mettre à jour un contact par ID”Mettre à jour un contact existant par ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);checkPermissions
Section intitulée “checkPermissions”Vérifiez l'état actuel des permissions pour les contacts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();requestPermissions
Section intitulée “requestPermissions”Demander les permissions 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 “CountContactsResult”Résultat de comptage des contacts.
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
Section intitulée « Créer des options 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 son 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 son 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 son 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.tsRe-run la synchronisation lorsque les données publiques API changent en amont.
Continuez de Getting Started
Section intitulée “Continuez de Getting Started”Si vous utilisez Getting Started pour planifier les opérations de tableau de bord et API , connectez-le avec Utilisation de @capgo/capacitor-contacts pour la capacité native dans Utilisation de @capgo/capacitor-contacts, API Vue d'ensemble pour les détails d'implémentation dans API Vue d'ensemble, Introduction pour les détails 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.