はじめに
このプラグインのインストール手順とフルマークダウンガイドを含むセットアッププロンプトをコピーする。
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-intercom`
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/intercom/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.
インストール
インストールbun add @capgo/capacitor-intercombunx cap syncインポート
インポートimport { CapgoIntercom } from '@capgo/capacitor-intercom';APIの概要
APIの概要loadWithKeys
__CAPGO_KEEP_2__APIキーを実行時で使用してIntercomを初期化します。 capacitor.configにキーを設定しない場合はこちらを使用してください。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.loadWithKeys({} as IntercomLoadOptions);registerIdentifiedUser
ユーザーを登録既知のユーザーをIntercomに登録します。少なくとも、ユーザーIDまたはメールアドレスの1つを指定する必要があります。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerIdentifiedUser({} as IntercomIdentifiedUserOptions);registerUnidentifiedUser
匿名ユーザーをIntercomに登録クリップボードにコピー
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.registerUnidentifiedUser();updateUser
クリップボードにコピーIntercomからログアウト
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.updateUser({} as IntercomUserUpdateOptions);logout
クリップボードにコピークリップボードにコピー
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logout();logEvent
イベントログカスタムイベントをIntercomに記録します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.logEvent({} as IntercomLogEventOptions);displayMessenger
セクション「メッセンジャー表示」Intercomのメッセンジャーを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessenger();displayMessageComposer
セクション「メッセージコンポーザー表示」プレフィルドメッセージでメッセージコンポーザーを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayMessageComposer({} as IntercomMessageComposerOptions);displayHelpCenter
セクション「ヘルプセンター表示」Intercomのヘルプセンターを開きます。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayHelpCenter();hideMessenger
「hideMessenger」セクションIntercomのメッセンジャーを非表示にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideMessenger();displayLauncher
「displayLauncher」セクションIntercomのランチャーボタンを表示します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayLauncher();hideLauncher
「hideLauncher」セクションIntercomのランチャーボタンを非表示にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideLauncher();displayInAppMessages
「displayInAppMessages」セクションIntercomのインアプリメッセージを有効にします。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayInAppMessages();hideInAppMessages
「hideInAppMessages」セクションIntercomのインアプリメッセージを非表示にする
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.hideInAppMessages();displayCarousel
「displayCarousel」セクション特定のIntercom カーレルを表示する
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayCarousel({} as IntercomCarouselOptions);displayArticle
「displayArticle」セクション特定のIntercom記事を表示する
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displayArticle({} as IntercomArticleOptions);displaySurvey
「displaySurvey」セクション特定のIntercomアンケートを表示する
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.displaySurvey({} as IntercomSurveyOptions);setUserHash
ユーザーハッシュを設定ユーザー認証のためにHMACを設定
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserHash({} as IntercomUserHashOptions);setUserJwt
ユーザーJWTを設定安全なメッセンジャーアUTHにJWTを設定
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setUserJwt({} as IntercomUserJwtOptions);setBottomPadding
IntercomメッセンジャーUIの下部パディングを設定クリップボードにコピー
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.setBottomPadding({} as IntercomBottomPaddingOptions);sendPushTokenToIntercom
クリップボードにコピーsetUserHash
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.sendPushTokenToIntercom({} as IntercomPushTokenOptions);receivePush
受信通知を処理する受信したIntercomのプッシュ通知を処理します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.receivePush({} as IntercomPushNotificationData);getUnreadConversationCount
未読会話の数を取得する現在のユーザーの未読会話の数を取得します。
import { CapgoIntercom } from '@capgo/capacitor-intercom';
await CapgoIntercom.getUnreadConversationCount();型の参照
型の参照IntercomLoadOptions
Intercomのロードオプションexport interface IntercomLoadOptions { appId?: string; apiKeyIOS?: string; apiKeyAndroid?: string;}IntercomIdentifiedUserOptions
Intercomの識別ユーザーオプションexport interface IntercomIdentifiedUserOptions { userId?: string; email?: string;}IntercomUserUpdateOptions
「IntercomUserUpdateOptions」セクションexport interface IntercomUserUpdateOptions { userId?: string; email?: string; name?: string; phone?: string; languageOverride?: string; customAttributes?: { [key: string]: any }; companies?: IntercomCompany[];}IntercomLogEventOptions
「IntercomLogEventOptions」セクションexport interface IntercomLogEventOptions { name: string; data?: { [key: string]: any };}IntercomMessageComposerOptions
「IntercomMessageComposerOptions」セクションexport interface IntercomMessageComposerOptions { message: string;}IntercomCarouselOptions
「IntercomCarouselOptions」セクションexport interface IntercomCarouselOptions { carouselId: string;}IntercomArticleOptions
「IntercomArticleOptions」セクションexport interface IntercomArticleOptions { articleId: string;}IntercomSurveyOptions
「IntercomSurveyOptions」セクションexport interface IntercomSurveyOptions { surveyId: string;}IntercomUserHashOptions
IntercomUserHashオプションexport interface IntercomUserHashOptions { hmac: string;}IntercomUserJwtOptions
IntercomUserJWTオプションexport interface IntercomUserJwtOptions { jwt: string;}IntercomBottomPaddingOptions
Intercomボトムパディングオプションexport interface IntercomBottomPaddingOptions { value: number;}IntercomPushTokenOptions
Intercomプッシュトークンオプションexport interface IntercomPushTokenOptions { value: string;}真実の源
真実の源このページはプラグインから生成されます。 src/definitions.tsパブリックAPIがアップストリームで変更された場合に再度同期を実行してください。