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-incoming-call-kit`
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/incoming-call-kit/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-incoming-call-kit -
ネイティブプロジェクトを同期
ターミナル画面 bunx cap sync -
Ringのソースを選択 着信イベントが来るのは、バックエンドから、SDKのようなTwilioまたはStreamから、またはネイティブのプッシュパスからFCMまたはPushKitから来るかどうかを決定します。
統合の仕組み
セクションのタイトル:統合の仕組みこのプラグインは、ネイティブの着信表示のみを所有します。アプリは依然としてトランスポート、認証、実際のメディアセッションを所有します。
一般的なプロダクションパターンは:
- あなたのバックエンドまたはSDKがRingイベントを発行します。
- あなたのアプリが
showIncomingCall(). - プラグインは、Incoming CallのネイティブUIを提示します。
callAccepted実際のルームまたはVoIPセッションにアプリを参加させるようにcallDeclined,callEndedまたはcallTimedOutリモート状態をクリーンアップするように
最小限の統合
セクション:最小限の統合import { IncomingCallKit } from '@capgo/capacitor-incoming-call-kit';
await IncomingCallKit.requestPermissions();await IncomingCallKit.requestFullScreenIntentPermission();
await IncomingCallKit.addListener('callAccepted', async ({ call }) => { console.log('Accepted', call.callId, call.extra); // Start or join your real call session here.});
await IncomingCallKit.addListener('callDeclined', ({ call }) => { console.log('Declined', call.callId); // Tell your backend or SDK that the user declined.});
await IncomingCallKit.addListener('callTimedOut', ({ call }) => { console.log('Timed out', call.callId); // Clear ringing state in your backend or SDK.});
await IncomingCallKit.showIncomingCall({ callId: 'call-42', callerName: 'Ada Lovelace', handle: '+39 555 010 020', appName: 'Capgo Phone', hasVideo: true, timeoutMs: 45_000, extra: { roomId: 'room-42', callerUserId: 'user_ada', }, android: { channelId: 'calls', channelName: 'Incoming Calls', showFullScreen: true, }, ios: { handleType: 'phoneNumber', },});重要なオプション
セクション:重要なオプションcallId: その後の再利用された安定した識別子endCall()timeoutMs最善の努力で回答しないタイムアウトextraリスナー パayload に反映される任意の JSONandroid.channelIdかつandroid.channelNameAndroid 通知 チャネル調整android.showFullScreenAndroid のフルスクリーンIncomingCallアクティビティを要求ios.handleType選択generic,phoneNumber、またはemailAddressCallKitのために
アクティブな通話の管理
アクティブな通話の管理const { calls } = await IncomingCallKit.getActiveCalls();
await IncomingCallKit.endCall({ callId: 'call-42', reason: 'remote-ended',});
await IncomingCallKit.endAllCalls({ reason: 'session-reset',});イベント モデル
イベントモデルincomingCallDisplayedネイティブUIが正常に表示されましたcallAcceptedユーザーがネイティブUIで承認しましたcallDeclinedユーザーが参加前に拒否されましたcallEndedアプリまたはプラットフォームがトラッキングされたコールを終了しましたcallTimedOutコールは未回答のままtimeoutMs
各イベントには正規化された call ペイロードと元のオブジェクトが含まれます。 extra プラットフォームの注記
プラットフォームの注記
プラットフォームの注記を読んでください- プラットフォームの注記を読んでください iOS ガイド __CAPGO_KEEP_0__ を PushKit または APNs フローに組み込む前に、CallKit について学びましょう。
- Read the Android ガイド Android 14 以降でフルスクリーン インテントに依存する場合は、まず Android ガイドを読んでください。
- Web はサポートされていません。
Getting Started から続けてください。
Getting Started から続けてください。計画ダッシュボードと __CAPGO_KEEP_0__ 操作を実行する場合は、@__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-incoming-call-kit を使用して接続してください。 Getting Started to plan dashboard and API operations, connect it with Using @capgo/capacitor-incoming-call-kit @capgo/capacitor-incoming-call-kitのネイティブ機能 APIの概要 @API/__CAPGO_KEEP_1__-incoming-call-kitの実装詳細 導入 @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-incoming-call-kitの実装詳細 @APIのキー @API/__CAPGO_KEEP_1__-incoming-call-kitの実装詳細と デバイス @__CAPGO_KEEP_0__/__CAPGO_KEEP_1__-incoming-call-kitの実装詳細