Zum Inhalt springen

Getting Started

GitHub

Sie können unsere AI-gestützte Einrichtung verwenden, um das Plugin zu installieren. Fügen Sie den Capgo-Fähigkeiten Ihrer AI-Anwendung mit der folgenden Befehlszeile hinzu:

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

Verwenden Sie dann 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:

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

Die Gesamtzahl der auf dem Gerät gespeicherten Kontaktinformationen ermitteln.

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

Ein neuer Kontakt programmatisch erstellen.

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

Ein neues Kontaktgruppen-Element erstellen.

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

Ein Kontakt durch ID löschen.

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

Ein Gruppe durch ID löschen.

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

Ein Kontakt mithilfe des native Kontakt-Viewers anzeigen.

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

Die native Erstellung des Kontakt-UI anzeigen.

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

Zeigt die native Aktualisierung der Kontakt-UI für einen bestimmten Kontakt an.

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

Alle auf dem Gerät verfügbaren Konten abrufen.

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

Abrufen eines bestimmten Kontakts durch ID.

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

Abrufen aller Kontakte vom Gerät.

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

Ermitteln Sie eine bestimmte Gruppe anhand der ID.

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

Ermitteln Sie alle Kontaktgruppen.

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

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

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

Überprüfen Sie, ob der 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();

Aktualisieren Sie einen bestehenden Kontakt durch ID.

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 anfordern, um auf Kontakte zuzugreifen.

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

Ergbnis der Kontaktzä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'>;
}

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

Ergebnis der Erstellung einer Gruppe

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

Optionen zum Löschen eines Kontakts durch ID.

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

Optionen zum Löschen einer Gruppe durch ID.

export interface DeleteGroupByIdOptions {
/**
* The ID of the group to delete.
*
* @since 1.0.0
*/
id: string;
}

Optionen zum Anzeigen eines Kontakts durch ID.

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

Optionen zum Anzeigen der native UI zum Erstellen eines Kontakts.

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

Erfolg aus der Anzeige der nativen UI für die Erstellung von Kontaktinformationen.

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 nativen UI für die Aktualisierung von Kontaktinformationen.

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

Erfolg aus der Abrufung von Konten.

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

Diese Seite wird aus der Plugin-Quelle generiert. src/definitions.ts. Wiederholen Sie die Synchronisierung, wenn sich der öffentliche API im Hintergrund ändert.

Wenn Sie "Anfangen" verwenden Anfangen um das Dashboard und die API-Funktionen zu planen, verbinden Sie es mit Verwenden Sie @capgo/capacitor-kontakte für die native Fähigkeit in Verwenden Sie @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.