Pemula
Salin prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
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.
Pasang
Bagian berjudul “Pasang”Anda dapat menggunakan Setup yang Dibantu AI kami untuk menginstal plugin. Tambahkan Capgo kemampuan ke alat AI Anda menggunakan perintah berikut:
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-pluginsKemudian gunakan prompt berikut:
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-contacts` plugin in my project.Jika Anda lebih suka Setup Manual, instal plugin dengan menjalankan perintah-perintah berikut dan ikuti instruksi spesifik platform di bawah ini:
bun add @capgo/capacitor-contactsbunx cap syncImpor
Judul Bagian “Impor”import { CapacitorContacts } from '@capgo/capacitor-contacts';Ringkasan API
Bagian berjudul “API Pengantar”countContacts
Bagian berjudul “countContacts”Hitung jumlah kontak di perangkat.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();createContact
Bagian berjudul “createContact”Buat kontak baru secara programatis.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createContact({} as CreateContactOptions);createGroup
Bagian berjudul “createGroup”Buat kelompok kontak baru.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createGroup({} as CreateGroupOptions);deleteContactById
Bagian berjudul “deleteContactById”Hapus kontak berdasarkan ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);deleteGroupById
Bagian berjudul “deleteGroupById”Hapus grup berdasarkan ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({} as DeleteGroupByIdOptions);displayContactById
Bagian berjudul “displayContactById”Tampilkan kontak menggunakan viewer kontak asli.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);displayCreateContact
Bagian berjudul “displayCreateContact”Tampilkan UI pembuatan kontak asli.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();displayUpdateContactById
Bagian berjudul “displayUpdateContactById”Tampilkan UI pembaruan kontak asli untuk kontak tertentu.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({} as DisplayUpdateContactByIdOptions);getAccounts
Bagian berjudul “getAccounts”Dapatkan semua akun yang tersedia di perangkat.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getAccounts();getContactById
Bagian berjudul “getContactById”Dapatkan kontak spesifik berdasarkan ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContactById({} as GetContactByIdOptions);getContacts
Bagian berjudul “getContacts”Dapatkan semua kontak dari perangkat.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();getGroupById
Bagian berjudul “getGroupById”Dapatkan grup spesifik berdasarkan ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroupById({} as GetGroupByIdOptions);getGroups
Bagian berjudul “getGroups”Dapatkan semua kelompok kontak.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();isAvailable
Bagian berjudul “isAvailable”Periksa jika kontak tersedia di perangkat.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();isSupported
Bagian berjudul “isSupported”Periksa jika plugin tersebut didukung di platform saat ini.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();openSettings
Bagian berjudul “openSettings”Buka pengaturan kontak perangkat.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
Bagian berjudul “pilihKontak”Pilih kontak tunggal menggunakan picker kontak native.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();pickContacts
Bagian berjudul “pilihKontakKanan”Pilih satu atau lebih kontak menggunakan picker kontak native.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();updateContactById
Bagian berjudul “updateKontakDenganId”Perbarui kontak yang sudah ada dengan ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);checkPermissions
Bagian berjudul “cekIzin”Periksa status izin saat ini untuk kontak.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();requestPermissions
Bagian berjudul “requestPermissions”Minta izin untuk mengakses kontak.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.requestPermissions();Referensi Tipe
Bagian berjudul “Type Reference”CountContactsResult
Bagian berjudul “CountContactsResult”Hasil dari menghitung kontak.
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
Bagian berjudul “CreateContactOptions”Opsi untuk membuat kontak.
export interface CreateContactOptions { /** * Contact information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ contact: Omit<Contact, 'id'>;}CreateContactResult
Bagian berjudul “CreateContactResult”Hasil dari membuat kontak.
export interface CreateContactResult { /** * The ID of the newly created contact. * * @since 1.0.0 */ id: string;}CreateGroupOptions
Bagian berjudul “CreateGroupOptions”Opsi untuk membuat grup.
export interface CreateGroupOptions { /** * Group information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ group: Omit<Group, 'id'>;}CreateGroupResult
Bagian berjudul “CreateGroupResult”Hasil dari membuat grup.
export interface CreateGroupResult { /** * The ID of the newly created group. * * @since 1.0.0 */ id: string;}DeleteContactByIdOptions
Bagian berjudul “DeleteContactByIdOptions”Opsi untuk menghapus kontak berdasarkan ID.
export interface DeleteContactByIdOptions { /** * The ID of the contact to delete. * * @since 1.0.0 */ id: string;}DeleteGroupByIdOptions
Bagian berjudul “DeleteGroupByIdOptions”Pilihan untuk menghapus grup berdasarkan ID.
export interface DeleteGroupByIdOptions { /** * The ID of the group to delete. * * @since 1.0.0 */ id: string;}DisplayContactByIdOptions
Bagian berjudul “DisplayContactByIdOptions”Pilihan untuk menampilkan kontak berdasarkan ID.
export interface DisplayContactByIdOptions { /** * The ID of the contact to display. * * @since 1.0.0 */ id: string;}DisplayCreateContactOptions
Bagian berjudul “DisplayCreateContactOptions”Pilihan untuk menampilkan UI pembuatan kontak asli.
export interface DisplayCreateContactOptions { /** * Optional pre-filled contact information for the create UI. * * @since 1.0.0 */ contact?: Omit<Contact, 'id'>;}DisplayCreateContactResult
Bagian berjudul “DisplayCreateContactResult”Hasil dari menampilkan UI pembuatan kontak asli.
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
Bagian berjudul “DisplayUpdateContactByIdOptions”Pilihan untuk menampilkan UI pembaruan kontak asli.
export interface DisplayUpdateContactByIdOptions { /** * The ID of the contact to update. * * @since 1.0.0 */ id: string;}GetAccountsResult
Bagian berjudul “GetAccountsResult”Hasil dari mendapatkan akun.
export interface GetAccountsResult { /** * List of accounts available on the device. * * @since 1.0.0 */ accounts: Account[];}Sumber Kebenaran
Bagian berjudul “Sumber Kebenaran”Halaman ini dihasilkan dari plugin’s. src/definitions.ts. Re-run sinkronisasi ketika publik API berubah secara upstream.
Lanjutkan dari Getting Started
Bagian berjudul “Lanjutkan dari Getting Started”Jika Anda menggunakan Mulai untuk merencanakan dashboard dan API operasi, hubungkannya dengan Menggunakan @capgo/capacitor-kontak untuk kemampuan asli dalam Menggunakan @capgo/capacitor-kontak API Ringkasan untuk detail implementasi dalam API Ringkasan Pendahuluan untuk detail implementasi dalam Pendahuluan API Kunci untuk detail implementasi dalam API Kunci, dan Perangkat untuk detail implementasi di Perangkat.