__CAPGO_KEEP_2__

はじめに

GitHub

CapgoのAIアシスタントセットアップを使用してプラグインをインストールできます。次のコマンドを使用して、CapgoスキルをAIツールに追加してください:

ターミナル画面
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-intercom` plugin in my project.

Manualセットアップを使用する場合は、以下のコマンドを実行して、以下のプラットフォーム固有の指示に従ってください:

ターミナル画面
bun add @capgo/capacitor-intercom
bunx cap sync
import { CapgoIntercom } from '@capgo/capacitor-intercom';

API オーバーヴィュー

「API オーバーヴィュー」

loadWithKeys

「loadWithKeys」

API キーを実行時で初期化します。 capacitor.configにキーを設定しない場合はこちらを使用してください。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);

registerIdentifiedUser

「registerIdentifiedUser」

識別されたユーザーをIntercomに登録します。 ユーザーIDまたはメールアドレスのいずれかを指定してください。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);

registerUnidentifiedUser

「registerUnidentifiedUser」

匿名ユーザーをIntercomに登録します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();

Intercomユーザー属性を更新します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);

Intercomからユーザーをログアウトします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();

Intercomにカスタムイベントをログします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);

Intercomメッセンジャーを開きます。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();

メッセージコンポーザーを開き、事前に埋め込まれたメッセージで開きます。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);

インターコムヘルプセンターを開きます。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();

インターコムメッセンジャーを非表示にします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();

インターコムランチャーボタンを表示します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();

Intercom ランチャーボタンを非表示にします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();

Intercom からインアプリメッセージを有効にします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();

Intercom からインアプリメッセージを無効にします。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();

特定の Intercom カーレルを表示します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);

特定のIntercom記事を表示します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);

特定のIntercom調査を表示します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);

ユーザー認証のためのHMACを設定します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);

安全なメッセンジャーアUTHのためのJWTを設定します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);

Intercom メッセンジャー UI の下部パディングを設定します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);

Intercom にプッシュ トークンを送信します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);

受信した Intercom プッシュ通知を処理します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);

現在のユーザーの未読会話の数を取得します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();
export interface IntercomLoadOptions {
appId?: string;
apiKeyIOS?: string;
apiKeyAndroid?: string;
}
export interface IntercomIdentifiedUserOptions {
userId?: string;
email?: string;
}
export interface IntercomUserUpdateOptions {
userId?: string;
email?: string;
name?: string;
phone?: string;
languageOverride?: string;
customAttributes?: { [key: string]: any };
companies?: IntercomCompany[];
}
export interface IntercomLogEventOptions {
name: string;
data?: { [key: string]: any };
}
export interface IntercomMessageComposerOptions {
message: string;
}
export interface IntercomCarouselOptions {
carouselId: string;
}
export interface IntercomArticleOptions {
articleId: string;
}
export interface IntercomSurveyOptions {
surveyId: string;
}
export interface IntercomUserHashOptions {
hmac: string;
}
export interface IntercomUserJwtOptions {
jwt: string;
}
export interface IntercomBottomPaddingOptions {
value: number;
}
export interface IntercomPushTokenOptions {
value: string;
}

真実の源

「真実の源」

このページはプラグインの src/definitions.tsAPIがアップストリームで変更された場合に、パブリック APIを再度同期してください。

Getting Startedから続けてください

「Getting Startedから続けてください」

あなたが Getting Started ダッシュボードとAPIの計画と実行を計画している場合、 Using @capgo/capacitor-intercom Using @capgo/capacitor-intercom API Overview API の実装詳細 Introduction Introduction の実装詳細 API Keys API Keys の実装詳細 Devices Devices の実装詳細