시작하기
설치 단계와 이 플러그인의 전체 마크다운 가이드를 포함한 설정 지시를 복사하세요.
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 -
링 소스를 선택하세요 incoming-call 이벤트가 백엔드에서 오는지, SDK와 같은 Twilio 또는 Stream과 같은 서비스에서 오는지, 또는 FCM 또는 PushKit과 같은 네이티브 푸시 경로에서 오는지 결정하세요.
통합이 어떻게 맞물리는지
통합이 어떻게 맞물리는지이 플러그인은 네이티브 incoming-call 표시만 관리합니다. 앱은 여전히 전송, 인증, 실제 미디어 세션을 관리합니다.
공통의 프로덕션 패턴은:
- SDK의 ring 이벤트를 발생시킨 백엔드 또는 SDK가 호출합니다.
- __CAPGO_KEEP_0__가
showIncomingCall(). - __CAPGO_KEEP_0__는 native incoming-call UI를 제공합니다.
callAccepted__CAPGO_KEEP_0__가 실제 회의나 VoIP 세션에 참여하도록 __CAPGO_KEEP_0__에게 지시합니다.callDeclined,callEnded또는callTimedOut__CAPGO_KEEP_0__가 remote 상태를 정리하도록 __CAPGO_KEEP_0__에게 지시합니다.
최소한의 통합
__CAPGO_KEEP_0__의 최소한의 통합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', },});중요한 옵션
__CAPGO_KEEP_0__의 중요한 옵션callId__CAPGO_KEEP_0__endCall()timeoutMs: __CAPGO_KEEP_0__extra: __CAPGO_KEEP_0__android.channelId그리고android.channelName: 안드로이드 알림 채널 조정android.showFullScreen: 안드로이드 전면 incoming-call 활동을 요청합니다.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',});이벤트 모델
Section titled “이벤트 모델”incomingCallDisplayed: 네이티브 UI가 성공적으로 표시되었습니다callAccepted: 사용자가 네이티브 UI에서 승인했습니다callDeclined: 사용자가 가입하기 전에 거부했습니다callEnded: 앱 또는 플랫폼이 추적된 전화 통화를 종료했습니다callTimedOut: 전화가 답변되지 않고timeoutMs
각 이벤트에는 정규화된 call 데이터와 원본 extra 객체가 포함되어 있습니다.