Zum Inhalt springen

Anleitung

GitHub

Sie können unsere KI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie die Capgo-Fähigkeiten zu Ihrem KI-Tool hinzu, indem Sie die folgende Anweisung verwenden:

Terminal-Fenster
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins

Dann verwenden Sie die folgende Anweisung:

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 die Plattform-spezifischen Anweisungen unten befolgen:

Terminalfenster
bun add @capgo/capacitor-contacts
bunx cap sync
import { CapacitorContacts } from '@capgo/capacitor-contacts';

Zähle die Gesamtzahl der Kontakte auf dem Gerät.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();

Erstelle ein neues Kontakt programmatisch.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createContact({} as CreateContactOptions);

Erstellen Sie eine neue Kontaktgruppe.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createGroup({} as CreateGroupOptions);

Löschen Sie einen Kontakt durch ID.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);

Löschen Sie eine Gruppe durch ID.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({} as DeleteGroupByIdOptions);

Abschnitt mit dem Titel „displayContactById“

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);

Zeigt die native UI für die Erstellung von Kontakten an.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();

Zeigt die native UI für die Aktualisierung eines bestimmten Kontakts an.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({} as DisplayUpdateContactByIdOptions);

Ermittelt alle auf dem Gerät verfügbaren Konten.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getAccounts();

Ermittelt einen bestimmten Kontakt nach ID.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContactById({} as GetContactByIdOptions);

Alle Kontakte vom Gerät abrufen.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();

Einen bestimmten Gruppe nach ID abrufen.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroupById({} as GetGroupByIdOptions);

Alle Kontaktgruppen abrufen.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();

Überprüfen, ob Kontakte auf dem Gerät verfügbar sind.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();

Überprüfen Sie, ob das Plugin auf der aktuellen Plattform unterstützt wird.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();

Öffnen Sie die Kontakteinstellungen des Geräts.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();

Wählen Sie einen Kontakt mit dem nativen Kontaktpicker aus.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();

Wählen Sie einen oder mehrere Kontakte mit dem nativen Kontaktpicker aus.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();

Ein bestehendes Kontakt durch ID aktualisieren.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);

Überprüfen Sie den aktuellen Berechtigungsstatus für Kontakte.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();

Berechtigungen zum Zugriff auf Kontakte anfordern.

import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.requestPermissions();

Erfolgsmeldung bei der Kontaktaufzählung.

export interface CountContactsResult {
/**
* Total number of contacts.
*
* @since 1.0.0
*/
count: number;
}

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'>;
}

Erfolgsmeldung bei der Erstellung eines Kontakts.

export interface CreateContactResult {
/**
* The ID of the newly created contact.
*
* @since 1.0.0
*/
id: string;
}

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'>;
}

Ergbnis der Erstellung einer Gruppe.

export interface CreateGroupResult {
/**
* The ID of the newly created group.
*
* @since 1.0.0
*/
id: string;
}

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;
}

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;
}

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;
}

Optionen für die Anzeige der native Erstellung von Kontakt-UI.

export interface DisplayCreateContactOptions {
/**
* Optional pre-filled contact information for the create UI.
*
* @since 1.0.0
*/
contact?: Omit<Contact, 'id'>;
}

Ergebnis der Anzeige der native Erstellung von Kontakt-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;
}

Optionen für die Anzeige der native Aktualisierung von Kontakt-UI.

export interface DisplayUpdateContactByIdOptions {
/**
* The ID of the contact to update.
*
* @since 1.0.0
*/
id: string;
}

Ergebnis der Abruf von Konten.

export interface GetAccountsResult {
/**
* List of accounts available on the device.
*
* @since 1.0.0
*/
accounts: Account[];
}

Diese Seite wurde aus dem Plugin generiert. src/definitions.ts. Wenn sich die öffentliche API im Hintergrund ändert, führen Sie den Sync erneut durch.

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.