メインコンテンツにスキップ
@capgo/capacitor-intercom コミュニケーション オープンソース

Intercom Capacitor プラグイン

Capacitor アプリにIntercomのライブチャット、ヘルプセンター、サポートワークフローを統合する

インストール

bun add @capgo/capacitor-intercom bunx cap sync
npm、pnpm、またはyarn
  • npm install @capgo/capacitor-intercom
  • pnpm add @capgo/capacitor-intercom
  • yarn add @capgo/capacitor-intercom

ガイド

How to use Intercom in Capacitor

デバイスでテスト

Capgoアプリをダウンロードし、QR codeをスキャンしてください。

Intercom プラグインのプレビューQRcode

使用方法:@capgo/capacitor-intercom

Intercom Capacitor プラグイン

インストール

bun add @capgo/capacitor-intercom
bunx cap sync

bunx cap sync codeのネイティブコードをプロジェクトにコピーします。プラグインのアップグレード後は再度実行してください。

インポート

import { CapgoIntercom } from '@capgo/capacitor-intercom';

APIの概要

方法 説明
loadWithKeys APIで初期化する。capacitor.configにキーを設定しない場合は使用します。
registerIdentifiedUser ユーザーIDまたはメールアドレスのいずれかを指定して、Intercomにユーザーを登録します。
registerUnidentifiedUser 匿名ユーザーをIntercomに登録します。
updateUser Intercomにユーザー属性を更新します。
logout Intercomからユーザーをログアウトします。
logEvent Intercomにカスタムイベントをログします。
displayMessenger Intercomのメッセンジャーを開きます。
displayMessageComposer メッセージを事前に埋め込んだ状態でIntercomのメッセージコンポーザーを開きます。
displayHelpCenter Intercomのヘルプセンターを開きます。
hideMessenger Intercomのメッセンジャーを非表示にします。
displayLauncher Intercomの起動ボタンを表示します。
hideLauncher Intercomの起動ボタンを非表示にします。
displayInAppMessages Intercomのインアプリメッセージを有効にします。
hideInAppMessages Intercomのインアプリメッセージを無効にします。
displayCarousel 特定のIntercomのキャラバンを表示します。
displayArticle 特定のIntercomの記事を表示します。
displaySurvey 特定のIntercomのアンケートを表示します。
setUserHash ID認証のためのHMACを設定します。
setUserJwt 安全なメッセンジャーの認証のためのJWTを設定します。
setBottomPadding IntercomメッセンジャーのUIの下部の余白を設定します。
sendPushTokenToIntercom Intercomにプッシュ通知トークンを送信します。
receivePush 受信したIntercomのプッシュ通知を処理します。
getUnreadConversationCount 現在のユーザーの未読会話の数を取得します。

例

loadWithKeys()

ランタイムでAPIキーを使用してIntercomを初期化します。capacitor.configにキーを設定しない場合はこちらを使用してください。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.loadWithKeys({
  appId: 'app-id-123',
  apiKeyIOS: 'api-key-ios',
  apiKeyAndroid: 'api-key-android',
});

registerIdentifiedUser()

__CAPGO_KEEP_1__.configにキーを設定せずに実行する場合は、__CAPGO_KEEP_0__キーの初期化を使用します。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerIdentifiedUser({
  userId: 'user-id-123',
  email: 'user@example.com',
});

registerUnidentifiedUser()

Intercomにユーザーを登録します。少なくともuserIdまたはemailの1つが必要です。

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.registerUnidentifiedUser();

updateUser()

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.updateUser({ userId: 'user-id-123' });

logout()

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.logout();

logEvent()

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

import { CapgoIntercom } from '@capgo/capacitor-intercom';

await CapgoIntercom.logEvent({ name: 'example' });

Intercomにカスタムイベントをログします。 上の表には、23の基本メソッドがリストされています。リスナーとバージョンヘルパー、各メソッドの完全な契約は、GitHubリポジトリにドキュメントされています。.

イベントをリスンします。

addListener リスナーを取得します。画面がアンマウントされたとき、またはリスナーをすべてクリアしたときに呼び出してください。 handle.remove() __CAPGO_KEEP_0__リポジトリ CapgoIntercom.removeAllListeners() __CAPGO_KEEP_0__

全体リファレンス

Capgo の @capgo/capacitor-intercom から続けてください

Capgo の @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-intercom を使用している場合 Capgo の @capgo/capacitor-intercom を接続してください Capacitor-Intercomをネイティブプラグイン作業に組み込むには、接続する @capgo/capacitor-intercom @capgo/capacitor-intercomの実装詳細 ドキュメント Capgo の @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-intercom から続けてください Capgo プラグインディレクトリ Capacitor製品ワークフロー向けに Capgo プラグインディレクトリ Capacitor Capgoのプラグイン for Capacitor の実装詳細については、Capgo によって提供されるプラグインをご覧ください。 プラグインの追加または更新 Capacitor製品ワークフロー向けにプラグインの追加または更新の実装詳細

FAQ

Intercom プラグイン FAQ

Capacitor-Intercom プラグインを Capacitor アプリにインストールする方法は何ですか。

Run "bun add @capgo/capacitor-intercom" (or "npm install @capgo/capacitor-intercom"), then run "bunx cap sync" so the iOS and Android projects pick up the native code. Import it from "@capgo/capacitor-intercom" in your app code.

@capgo/capacitor-intercomは、React、Vue、Angularとどのくらいの関係があるのでしょうか。

Yes. Intercom is a Capacitor package, so it works with any web framework that runs inside Capacitor, including Ionic, React, Vue, Angular, Svelte and plain JavaScript.

Which Capacitor version does @capgo/capacitor-intercom support?

Capgo plugins follow Capacitor's major version: use the plugin major version that matches your Capacitor major version (for example plugin v8 with Capacitor 8). The compatibility table in the GitHub README lists the maintained versions.

@capgo/capacitor-intercomは無料でオープンソースですか?

Yes. The source code is public on GitHub at https://github.com/Cap-go/capacitor-intercom/ and the package is free to install from npm. Bug reports and pull requests are welcome.

App Store レビューなしで、Intercom を使用する code をアップデートできますか。

Installing or upgrading the plugin changes native code, so it needs a new store build. After that, JavaScript, HTML and CSS changes that call the plugin can ship instantly with Capgo live updates.

アプリレビューの待ちなしでIntercomの変更を配信

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo