Getting Started
このプラグインのインストールステップとフルマークダウンガイドまでのセットアップの質問をコピーする
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.
インストール
「インストール」のセクションCapgoのAI-Assisted Setupを使用してプラグインをインストールできます。AIツールにCapgoスキルを追加するには、以下のコマンドを実行してください。
npx skills add https://github.com/Cap-go/capgo-skills --skill capacitor-plugins次に、以下のプロンプトを使用してください。
Use the `capacitor-plugins` skill from `Cap-go/capgo-skills` to install the `@capgo/capacitor-contacts` plugin in my project.Manual Setupを使用する場合は、以下のコマンドを実行してプラグインをインストールし、以下のプラットフォーム固有の指示に従ってください。
bun add @capgo/capacitor-contactsbunx cap syncインポート
「インポート」セクションimport { CapacitorContacts } from '@capgo/capacitor-contacts';API オーバービュー
「API オーバービュー」セクションcountContacts
「countContacts」セクションデバイス上の連絡先の総数をカウントします。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.countContacts();createContact
「createContact」セクションプログラムで新しい連絡先を作成します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createContact({} as CreateContactOptions);createGroup
「createGroup」セクション新しい連絡先グループを作成します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.createGroup({} as CreateGroupOptions);deleteContactById
「deleteContactById」セクションIDで連絡先を削除します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({} as DeleteContactByIdOptions);deleteGroupById
「deleteGroupById」セクションIDでグループを削除します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({} as DeleteGroupByIdOptions);displayContactById
「displayContactById」セクションネイティブの連絡先ビューアで連絡先を表示します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({} as DisplayContactByIdOptions);displayCreateContact
Section titled “displayCreateContact”Display the native create contact UI.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayCreateContact();displayUpdateContactById
Section titled “displayUpdateContactById”Display the native update contact UI for a specific contact.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({} as DisplayUpdateContactByIdOptions);getAccounts
Section titled “getAccounts”Get all accounts available on the device.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getAccounts();getContactById
Section titled “getContactById”Get a specific contact by ID.
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContactById({} as GetContactByIdOptions);getContacts
Section titled “getContacts”デバイスからすべての連絡先を取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getContacts();getGroupById
Section titled “getGroupById”IDで特定のグループを取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroupById({} as GetGroupByIdOptions);getGroups
Section titled “getGroups”デバイス上のすべての連絡先グループを取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.getGroups();isAvailable
Section titled “isAvailable”デバイス上の連絡先が利用可能かどうかを確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isAvailable();isSupported
isSupportedのセクション現在のプラットフォームでプラグインがサポートされているかどうかを確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.isSupported();openSettings
openSettingsのセクションデバイスの連絡先設定を開きます。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
pickContactのセクションネイティブの連絡先ピッカーを使用して単一の連絡先を選択します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContact();pickContacts
pickContactsのセクションネイティブの連絡先ピッカーを使用して1つ以上の連絡先を選択します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.pickContacts();updateContactById
Section titled “updateContactById”IDで指定された既存の連絡先を更新します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({} as UpdateContactByIdOptions);checkPermissions
Section titled “checkPermissions”連絡先の現在の権限状態を確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.checkPermissions();requestPermissions
Section titled “requestPermissions”連絡先へのアクセス権を要求します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.requestPermissions();Type Reference
Section titled “Type Reference”CountContactsResult
Section titled “CountContactsResult”人と人との接点の数を数えた結果です。
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
「CreateContactOptions」のセクション連絡先を作成するためのオプションです。
export interface CreateContactOptions { /** * Contact information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ contact: Omit<Contact, 'id'>;}CreateContactResult
「CreateContactResult」のセクション連絡先を作成した結果です。
export interface CreateContactResult { /** * The ID of the newly created contact. * * @since 1.0.0 */ id: string;}CreateGroupOptions
「CreateGroupOptions」のセクショングループを作成するためのオプションです。
export interface CreateGroupOptions { /** * Group information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ group: Omit<Group, 'id'>;}CreateGroupResult
「CreateGroupResult」のセクショングループを作成した結果。
export interface CreateGroupResult { /** * The ID of the newly created group. * * @since 1.0.0 */ id: string;}DeleteContactByIdOptions
「DeleteContactByIdOptions」のセクションIDで削除する連絡先のオプション
export interface DeleteContactByIdOptions { /** * The ID of the contact to delete. * * @since 1.0.0 */ id: string;}DeleteGroupByIdOptions
「DeleteGroupByIdOptions」のセクションIDで削除するグループのオプション
export interface DeleteGroupByIdOptions { /** * The ID of the group to delete. * * @since 1.0.0 */ id: string;}DisplayContactByIdOptions
「DisplayContactByIdOptions」のセクションIDで表示する連絡先のオプション
export interface DisplayContactByIdOptions { /** * The ID of the contact to display. * * @since 1.0.0 */ id: string;}DisplayCreateContactOptions
「DisplayCreateContactOptions」のセクションOptions for displaying the native create contact UI.
export interface DisplayCreateContactOptions { /** * Optional pre-filled contact information for the create UI. * * @since 1.0.0 */ contact?: Omit<Contact, 'id'>;}DisplayCreateContactResult
Section titled “DisplayCreateContactResult”Result from displaying the native create contact 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
Section titled “DisplayUpdateContactByIdOptions”Options for displaying the native update contact UI.
export interface DisplayUpdateContactByIdOptions { /** * The ID of the contact to update. * * @since 1.0.0 */ id: string;}GetAccountsResult
Section titled “GetAccountsResult”Result from getting accounts.
export interface GetAccountsResult { /** * List of accounts available on the device. * * @since 1.0.0 */ accounts: Account[];}Source Of Truth
真実の源このページはプラグインから生成されています。 src/definitions.ts. 公開 API がアップストリームで変更された場合に、再度同期を実行してください。
Getting Started から続けてください。
Getting Started から続けてください。あなたが「 Getting Started 」を使用してダッシュボードと API の操作を計画している場合、 「@capgo/capacitor-contacts」 「@capgo/capacitor-contacts」 API Overview 「API Overview」 概要 概要の実装詳細について API キー API キーの実装詳細について デバイス デバイスの実装詳細について