Getting Started
Kopieren Sie eine Einrichtungsanleitung mit den Installationsanweisungen und der vollständigen Markdown-Dokumentation für dieses 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.
Installieren
Abschnitt mit dem Titel „Installieren“Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie die Capgo-Fähigkeiten zu Ihrer KI-Tool mithilfe der folgenden Befehl hinzu:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsDann verwenden Sie die folgende Anfrage:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-contacts` plugin in my project.Wenn Sie die manuelle Einrichtung bevorzugen, installieren Sie das Plugin, indem Sie die folgenden Befehle ausführen und folgen Sie den unten angegebenen Plattform-spezifischen Anweisungen:
bun add @capgo/capacitor-contactsbunx cap syncImportieren
Abschnitt mit dem Titel „Importieren“import { CapacitorContacts } from '@capgo/capacitor-contacts';API Übersicht
Abschnitt mit dem Titel „API Übersicht“countContacts
Abschnitt mit dem Titel „countContacts“Zähle die Gesamtzahl der Kontakte auf dem Gerät.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();createContact
Abschnitt mit dem Titel „createContact“Erstelle einen neuen Kontakt programmatisch.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createContact({} as CreateContactOptions);createGroup
Abschnitt mit dem Titel „createGroup“Erstellen Sie ein neues Kontaktgruppen.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createGroup({} as CreateGroupOptions);deleteContactById
Abschnitt mit dem Titel „deleteContactById“Löschen Sie einen Kontakt durch ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);deleteGroupById
Abschnitt mit dem Titel „deleteGroupById“Löschen Sie eine Gruppe durch ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({} as DeleteGroupByIdOptions);displayContactById
Abschnitt mit dem Titel „deleteGroupById“Löschen Sie eine Gruppe durch ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);displayCreateContact
Abschnitt mit dem Titel „displayCreateContact“Zeigt die native UI für die Erstellung von Kontakten an.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();displayUpdateContactById
Abschnitt mit dem Titel „displayUpdateContactById“Zeigt die native UI für die Aktualisierung eines bestimmten Kontakts an.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({} as DisplayUpdateContactByIdOptions);getAccounts
Abschnitt mit dem Titel „getAccounts“Ermittelt alle auf dem Gerät verfügbaren Konten.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getAccounts();getContactById
Abschnitt mit dem Titel „getContactById“Ermittelt einen bestimmten Kontakt nach ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContactById({} as GetContactByIdOptions);getContacts
Abschnitt mit dem Titel „getContacts“Alle Kontakte vom Gerät abrufen.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();getGroupById
Abschnitt mit dem Titel „getGroupById“Ein bestimmtes Gruppe nach ID abrufen.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroupById({} as GetGroupByIdOptions);getGroups
Abschnitt mit dem Titel „getGroups“Alle Kontaktgruppen abrufen.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();isAvailable
Abschnitt mit dem Titel „isAvailable“Überprüfen, ob Kontakte auf dem Gerät verfügbar sind.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();isSupported
Abschnitt mit dem Titel „isSupported“Überprüfen Sie, ob das Plugin auf der aktuellen Plattform unterstützt wird.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();openSettings
Abschnitt mit dem Titel „openSettings“Öffnen Sie die Kontakteinstellungen des Geräts.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
Abschnitt mit dem Titel „pickContact“Wählen Sie einen Kontakt mit dem nativen Kontaktpicker aus.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();pickContacts
Abschnitt mit dem Titel „pickContacts“Wählen Sie einen oder mehrere Kontakte mit dem nativen Kontaktpicker aus.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();updateContactById
Abschnitt mit dem Titel „updateContactById“Ein bestehendes Kontakt durch ID aktualisieren.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);checkPermissions
Abschnitt mit dem Titel „checkPermissions“Überprüfen Sie den aktuellen Berechtigungsstatus für Kontakte.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();requestPermissions
Abschnitt mit dem Titel „requestPermissions“Berechtigungen zum Zugriff auf Kontakte anfordern.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.requestPermissions();Typenreferenz
Abschnitt mit dem Titel „Typenreferenz“CountContactsResult
Abschnitt mit dem Titel “CountContactsResult”Ergebnis der Kontaktzählung.
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
Abschnitt mit dem Titel “CreateContactOptions”Optionen für die Erstellung eines Kontakts.
export interface CreateContactOptions { /** * Contact information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ contact: Omit<Contact, 'id'>;}CreateContactResult
Abschnitt mit dem Titel “CreateContactResult”Ergebnis der Erstellung eines Kontakts.
export interface CreateContactResult { /** * The ID of the newly created contact. * * @since 1.0.0 */ id: string;}CreateGroupOptions
Abschnitt mit dem Titel “CreateGroupOptions”Optionen für die Erstellung einer Gruppe.
export interface CreateGroupOptions { /** * Group information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ group: Omit<Group, 'id'>;}CreateGroupResult
Abschnitt mit dem Titel “CreateGroupResult”Ergebnis der Erstellung einer Gruppe.
export interface CreateGroupResult { /** * The ID of the newly created group. * * @since 1.0.0 */ id: string;}DeleteContactByIdOptions
Abschnitt mit dem Titel “DeleteContactByIdOptions”Optionen für die Löschung eines Kontakts durch ID.
export interface DeleteContactByIdOptions { /** * The ID of the contact to delete. * * @since 1.0.0 */ id: string;}DeleteGroupByIdOptions
Abschnitt mit dem Titel “DeleteGroupByIdOptions”Optionen für die Löschung einer Gruppe durch ID.
export interface DeleteGroupByIdOptions { /** * The ID of the group to delete. * * @since 1.0.0 */ id: string;}DisplayContactByIdOptions
Abschnitt mit dem Titel “DisplayContactByIdOptions”Optionen für die Anzeige eines Kontakts durch ID.
export interface DisplayContactByIdOptions { /** * The ID of the contact to display. * * @since 1.0.0 */ id: string;}DisplayCreateContactOptions
Abschnitt mit dem Titel “Erstellen Sie Kontakteinstellungen anzuzeigen”Optionen zum Anzeigen der native Erstellungskontakt-UI.
export interface DisplayCreateContactOptions { /** * Optional pre-filled contact information for the create UI. * * @since 1.0.0 */ contact?: Omit<Contact, 'id'>;}DisplayCreateContactResult
Abschnitt mit dem Titel “Ergebnis der Anzeige der native Erstellungskontakt-UI”Ergebnis der Anzeige der native Erstellungskontakt-UI.
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
Abschnitt mit dem Titel “Optionen zum Anzeigen der native Aktualisierungskontakt-UI”Optionen zum Anzeigen der native Aktualisierungskontakt-UI.
export interface DisplayUpdateContactByIdOptions { /** * The ID of the contact to update. * * @since 1.0.0 */ id: string;}GetAccountsResult
Abschnitt mit dem Titel “Ergebnis der Abfrage der Konten”Ergebnis der Abfrage der Konten.
export interface GetAccountsResult { /** * List of accounts available on the device. * * @since 1.0.0 */ accounts: Account[];}Quelle der Wahrheit
Abschnitt mit dem Titel “Quelle der Wahrheit”Diese Seite wird aus dem Plugin generiert. src/definitions.ts. Wenn sich die öffentliche API im Hintergrund ändert, führen Sie die Synchronisation erneut durch.
Fortsetzung von Getting Started
Abschnitt mit dem Titel “Fortsetzung von Getting Started”Wenn Sie das Plugin verwenden Getting Started um das Dashboard und die API-Operationen zu planen, verbinden Sie es mit Mit @capgo/capacitor-kontakte Für die native Fähigkeit in Mit @capgo/capacitor-kontakte, API-Übersicht für die Implementierungsdetails in API Übersicht Einführung für die Implementierungsdetails in Einführung API Schlüssel für die Implementierungsdetails in API Schlüssel und Geräte für die Implementierungsdetails in Geräte.