내용으로 건너뛰기

Getting Started

GitHub
  1. Install the package

    Terminal window
    bun add @capgo/capacitor-incoming-call-kit
  2. Sync native projects

    Terminal window
    bunx cap sync
  3. Choose your ring source Decide whether the incoming-call event comes from your backend, an SDK such as Twilio or Stream, or a native push path such as FCM or PushKit.

This plugin only owns native incoming-call presentation. Your app still owns transport, authentication, and the actual media session.

The common production pattern is:

  1. SDK의 ring 이벤트를 발생시킨 백엔드 또는 SDK가 호출됩니다.
  2. __CAPGO_KEEP_0__이 호출합니다. showIncomingCall().
  3. native incoming-call UI를 제공하는 플러그인이 있습니다.
  4. callAccepted 실제 회의나 VoIP 세션에 __CAPGO_KEEP_0__을 참여시킵니다.
  5. callDeclined, callEnded또는 callTimedOut __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',
},
});

중요한 옵션

중요한 옵션
  • callId: __CAPGO_KEEP_0__ endCall()
  • timeoutMs최선을 다하는 답변이 없는 타임아웃
  • extra리스너 페이로드에 임의의 JSON이 반영됩니다.
  • android.channelId 그리고 android.channelNameAndroid 알림 채널 조정
  • android.showFullScreenAndroid incoming-call 활동을 요청합니다.
  • ios.handleType선택하세요. generic, phoneNumber, 또는 emailAddress CallKit

전화 관리

전화 관리
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 가이드 iOS 플랫폼에 CallKit을 PushKit 또는 APNs 흐름에 통합하기 전에.
  • Read the Android 가이드 Android 14 이상에서 전체 화면 인텐트에 의존하기 전에.
  • Web은 지원되지 않습니다.

Getting Started에서 계속하기

Getting Started에서 계속하기

Getting Started를 사용하여 dashboard 및 __CAPGO_KEEP_0__ 작업을 계획하고 있습니다. __CAPGO_KEEP_0__를 __CAPGO_KEEP_1__-incoming-call-kit와 연결하세요. Using @API/__CAPGO_KEEP_1__-incoming-call-kit Using @capgo/capacitor-incoming-call-kit capgo의 원천 기능을 위한 @capacitor/capgo-incoming-call-kit을 사용하세요. API 개요 API의 구현 세부 정보를 위한 API 개요 소개 소개의 구현 세부 정보를 위한 __CAPGO_KEEP_0__ API 키 API 키의 구현 세부 정보를 위한 API 및 기기 기기의 구현 세부 정보를 위한 기기.