ページ/エリア: Capgo マーケティング ウェブサイト。役割: ウェブサイト コピー文。見られる場所: コンポーネント Hero.astro。メッセージ キー `hero_subtitle_v2` (Hero Subtitle V2)。
このプラグインのインストール手順とマークダウンガイドを含むセットアッププロンプトをコピーします。
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.
インストール
「インストール」のセクションAI-Assisted セットアップを使用してプラグインをインストールできます。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';
const result = await CapacitorContacts.countContacts();console.log(result);createContact
セクション「createContact」プログラムで新しい連絡先を作成します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.createContact({ contact: {} });console.log(result);createGroup
セクション「createGroup」新しい連絡先グループを作成します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.createGroup({ group: { name: 'example' } });console.log(result);deleteContactById
セクション「deleteContactById」IDで連絡先を削除します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteContactById({ id: 'id-123' });deleteGroupById
セクション「deleteGroupById」グループをIDで削除します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.deleteGroupById({ id: 'id-123' });displayContactById
「displayContactById」セクションネイティブの連絡先ビューアを使用して連絡先を表示します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayContactById({ id: 'id-123' });displayCreateContact
「displayCreateContact」セクションネイティブの連絡先作成UIを表示します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.displayCreateContact();console.log(result);displayUpdateContactById
「displayUpdateContactById」セクション特定の連絡先のネイティブの連絡先更新UIを表示します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.displayUpdateContactById({ id: 'id-123' });getAccounts
「getAccounts」セクションデバイス上のすべてのアカウントを取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.getAccounts();console.log(result);getContactById
セクション「getContactById」特定のIDを持つ特定の連絡先を取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.getContactById({ id: 'id-123' });// The result holds sensitive values: use it without logging it.getContacts
セクション「getContacts」デバイス上のすべての連絡先を取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.getContacts();// The result holds sensitive values: use it without logging it.getGroupById
セクション「getGroupById」特定のIDを持つ特定のグループを取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.getGroupById({ id: 'id-123' });console.log(result);getGroups
セクション「getGroups」すべての連絡先グループを取得します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.getGroups();console.log(result);isAvailable
「isAvailable」セクションデバイス上の連絡先が利用可能かどうかを確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.isAvailable();console.log(result);isSupported
「isSupported」セクション現在のプラットフォームでプラグインがサポートされているかどうかを確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.isSupported();console.log(result);openSettings
「openSettings」セクションデバイスの連絡先設定を開きます。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.openSettings();pickContact
「pickContact」セクション1つの連絡先をネイティブの連絡先ピッカーから選択してください。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.pickContact();// The result holds sensitive values: use it without logging it.pickContacts
セクション「pickContacts」1つ以上の連絡先をネイティブの連絡先ピッカーから選択してください。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.pickContacts();// The result holds sensitive values: use it without logging it.updateContactById
セクション「updateContactById」既存の連絡先をIDで更新します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
await CapacitorContacts.updateContactById({ id: 'id-123', contact: {},});checkPermissions
セクション「checkPermissions」連絡先の現在の許可状態を確認します。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.checkPermissions();console.log(result);requestPermissions
セクション「requestPermissions」連絡先へのアクセスを許可する。
import { CapacitorContacts } from '@capgo/capacitor-contacts';
const result = await CapacitorContacts.requestPermissions();console.log(result);タイプ リファレンス
タイプ リファレンスCountContactsResult
連絡先の数を数える結果タイプ リファレンス
export interface CountContactsResult { /** * Total number of contacts. * * @since 1.0.0 */ count: number;}CreateContactOptions
連絡先を作成するためのオプション連絡先を作成する結果
export interface CreateContactOptions { /** * Contact information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ contact: Omit<Contact, 'id'>;}CreateContactResult
連絡先を作成する結果連絡先の数を数える結果
export interface CreateContactResult { /** * The ID of the newly created contact. * * @since 1.0.0 */ id: string;}CreateGroupOptions
「グループ作成オプション」のセクショングループを作成するためのオプション
export interface CreateGroupOptions { /** * Group information to create. The 'id' field will be generated automatically. * * @since 1.0.0 */ group: Omit<Group, 'id'>;}CreateGroupResult
「グループ作成結果」のセクショングループを作成した結果
export interface CreateGroupResult { /** * The ID of the newly created group. * * @since 1.0.0 */ id: string;}DeleteContactByIdOptions
「IDで連絡先を削除するオプション」のセクションIDで連絡先を削除するためのオプション
export interface DeleteContactByIdOptions { /** * The ID of the contact to delete. * * @since 1.0.0 */ id: string;}DeleteGroupByIdOptions
「IDでグループを削除するオプション」のセクション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」のセクションネイティブの新規連絡先UIを表示するためのオプション
export interface DisplayCreateContactOptions { /** * Optional pre-filled contact information for the create UI. * * @since 1.0.0 */ contact?: Omit<Contact, 'id'>;}DisplayCreateContactResult
「DisplayCreateContactResult」のセクションネイティブの新規連絡先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
「DisplayUpdateContactByIdOptions」のセクションネイティブの連絡先更新UIを表示するためのオプション
export interface DisplayUpdateContactByIdOptions { /** * The ID of the contact to update. * * @since 1.0.0 */ id: string;}GetAccountsResult
「GetAccountsResult」のセクションアカウントを取得した結果
export interface GetAccountsResult { /** * List of accounts available on the device. * * @since 1.0.0 */ accounts: Account[];}ソース オブ トゥルース
「ソース オブ トゥルース」のセクションこのページはプラグインの src/definitions.tsパブリック API がアップストリームで変更されたときは、再度同期を実行してください。
「Getting Started」から続けて
「Getting Started」から続けて」のセクションあなたが 「Getting Started」 ダッシュボードとAPIの作業を計画し、接続する Capgoを使用して@capgo/capacitor連絡先を取得します。 Using @capgo/capacitor-contacts APIの概要 APIの概要 導入 導入 APIのキー APIのキー デバイス デバイス