@capgo/capacitor-incoming-call-kit

中文文档
8.2.14发布于 2026/10/15MPL-2.0TypeScriptESM + CJS零依赖构建来源已验证近 30 天下载 5911

Capacitor plugin for native incoming call UI with Android full-screen notifications and iOS CallKit.

原始使用文档
文档目录31 节
  1. ➡️ Get started for free
  2. Key features
  3. Documentation
  4. Compatibility
  5. Install
  6. What This Plugin Does
  7. What This Plugin Does Not Do
  8. Quick Start
  9. Event Model
  10. Platform Notes
  11. Android
  12. iOS
  13. Choosing An Architecture
  14. Example App
  15. API
  16. showIncomingCall(...)
  17. endCall(...)
  18. endAllCalls(...)
  19. getActiveCalls()
  20. checkPermissions()
  21. requestPermissions()
  22. requestFullScreenIntentPermission()
  23. getPluginVersion()
  24. addListener('incomingCallDisplayed', ...)
  25. addListener('callAccepted', ...)
  26. addListener('callDeclined', ...)
  27. addListener('callEnded', ...)
  28. addListener('callTimedOut', ...)
  29. removeAllListeners()
  30. Interfaces
  31. Type Aliases

@capgo/capacitor-incoming-call-kit

Show a native incoming call screen from your Capacitor app: CallKit on iOS and high-priority notifications on Android that can open a full-screen call screen. Ring the user for VoIP calls, video calls and alerts that need an answer.

Capgo - Build Capacitor apps with AI, ship updates instantly

Capgo: push fixes to your Capacitor users in minutes, build signed iOS and Android apps without a Mac, and roll back in one click.

➡️ Get started for free

14-day unlimited free trial. No credit card required

🤖 Building with an AI coding agent? Install Capgo skills so Claude Code, Codex, Cursor, Copilot, or Gemini CLI know how to install and use @capgo/capacitor-incoming-call-kit in your Capacitor app: npx skills add Cap-go/capgo-skills. Then ask your agent: "Add @capgo/capacitor-incoming-call-kit to my Capacitor app and wire it up." Agent setup guides · Hosted MCP

@capgo/capacitor-incoming-call-kit for Capacitor apps

Key features

  • Incoming call UI: showIncomingCall() displays the native ringing screen.
  • Call events: callEnded, callTimedOut and incomingCallDisplayed listeners, plus callAccepted and callDeclined on iOS and Android.
  • Call tracking: getActiveCalls(), endCall() and endAllCalls().
  • Permissions: checkPermissions(), requestPermissions() and requestFullScreenIntentPermission() for Android 14 and later.
  • Platforms: iOS and Android. iOS uses CallKit. Android uses high-priority notifications that can raise a full-screen activity. Web is a basic stub.

Display a native incoming-call surface in Capacitor with Android full-screen notifications and iOS CallKit.

This plugin was built for teams who want something in the same space as olarewajuakeemope/capacitor-incoming-call-kit, but with a small API, typed events, clearer platform boundaries, and documentation you can actually ship from.

Documentation

The most complete doc is available here: https://capgo.app/docs/plugins/incoming-call-kit/

Compatibility

Plugin versionCapacitor compatibilityMaintained
v8.*.*v8.*.*✅
v7.*.*v7.*.*On demand
v6.*.*v6.*.*❌

Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation. Only the latest major version is actively maintained.

Install

You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:

npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins

Then use the following prompt:

Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-incoming-call-kit` plugin in my project.

If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:

bun add @capgo/capacitor-incoming-call-kit
bunx cap sync

What This Plugin Does

  • Shows a native incoming call UI from JavaScript.
  • Emits buffered callAccepted, callDeclined, callEnded, and callTimedOut events so the action still reaches JS if the bridge was cold.
  • Uses Android notifications plus a full-screen activity.
  • Uses iOS CallKit for the system incoming-call sheet.
  • Keeps the push transport out of scope so you can wire it to your own FCM, PushKit, SIP, or backend flow.

What This Plugin Does Not Do

  • It does not register FCM, APNs, or PushKit for you.
  • It does not create or manage the underlying audio/video session.
  • It does not replace your VoIP SDK. It only handles the native incoming-call presentation layer.

Quick Start

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);
  // Join your voice/video session here.
});

await IncomingCallKit.addListener('callDeclined', ({ call }) => {
  console.log('Declined:', call.callId);
});

await IncomingCallKit.addListener('callTimedOut', ({ call }) => {
  console.log('Timed out:', call.callId);
});

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',
  },
});

Event Model

  • incomingCallDisplayed: native UI was shown successfully.
  • callAccepted: the user accepted from the native UI.
  • callDeclined: the user declined before joining.
  • callEnded: your app or the platform ended the tracked call.
  • callTimedOut: the call stayed unanswered until timeoutMs.

Each event carries the normalized call payload and your original extra object.

Platform Notes

Android

  • requestPermissions() requests POST_NOTIFICATIONS on Android 13+.
  • requestFullScreenIntentPermission() opens the Android 14+ settings page for full-screen intents.
  • showIncomingCall() posts a high-priority notification and can raise a full-screen activity while the app is already running.
  • The timeout is best-effort and also uses the notification timeout when available.

iOS

  • showIncomingCall() reports the call to CallKit.
  • CallKit itself does not require a runtime permission prompt, so requestPermissions() resolves immediately on iOS.
  • Your app is responsible for starting the real call session after callAccepted.
  • If you need background incoming-call delivery from VoIP pushes, wire your PushKit/APNs flow to call this plugin as soon as your Capacitor bridge is available.

Choosing An Architecture

  • If your app already uses Twilio, Stream, Daily, or a SIP stack, use this plugin as the native ringing layer and keep the media session in your existing SDK.
  • If you only need foreground testing or a custom backend event, calling showIncomingCall() directly from JS is enough.
  • If you need true background delivery, pair this plugin with your own native push integration instead of baking a push provider into the plugin itself.

Example App

The repository includes example-app with a small control panel for:

  • requesting permissions,
  • showing a demo incoming call,
  • inspecting active calls,
  • and watching listener payloads in real time.

API

Capacitor API for presenting a native incoming-call surface.

showIncomingCall(...)

showIncomingCall(options: ShowIncomingCallOptions) => Promise<ShowIncomingCallResult>

Displays the native incoming call UI.

Android shows a high-priority notification and can raise a full-screen activity. iOS reports the call to CallKit.

ParamType
optionsShowIncomingCallOptions

Returns: Promise<ShowIncomingCallResult>


endCall(...)

endCall(options: EndCallOptions) => Promise<ActiveCallsResult>

Ends a specific tracked call.

ParamType
optionsEndCallOptions

Returns: Promise<ActiveCallsResult>


endAllCalls(...)

endAllCalls(options?: EndAllCallsOptions | undefined) => Promise<ActiveCallsResult>

Ends every tracked call.

ParamType
optionsEndAllCallsOptions

Returns: Promise<ActiveCallsResult>


getActiveCalls()

getActiveCalls() => Promise<ActiveCallsResult>

Returns the currently tracked calls.

Returns: Promise<ActiveCallsResult>


checkPermissions()

checkPermissions() => Promise<IncomingCallPermissionStatus>

Returns the current permission state for notifications and full-screen intents.

Returns: Promise<IncomingCallPermissionStatus>


requestPermissions()

requestPermissions() => Promise<IncomingCallPermissionStatus>

Requests the notification permission when the platform supports it.

iOS CallKit itself does not require a runtime prompt, so iOS resolves without prompting.

Returns: Promise<IncomingCallPermissionStatus>


requestFullScreenIntentPermission()

requestFullScreenIntentPermission() => Promise<IncomingCallPermissionStatus>

Opens the Android 14+ full-screen intent settings page when available.

On other platforms this resolves with the current permission status.

Returns: Promise<IncomingCallPermissionStatus>


getPluginVersion()

getPluginVersion() => Promise<PluginVersionResult>

Returns the native implementation version marker.

Returns: Promise<PluginVersionResult>


addListener('incomingCallDisplayed', ...)

addListener(eventName: 'incomingCallDisplayed', listenerFunc: (event: IncomingCallEvent) => void) => Promise<PluginListenerHandle>

Fired after the call has been handed to the native platform UI.

ParamType
eventName'incomingCallDisplayed'
listenerFunc(event: IncomingCallEvent) => void

Returns: Promise<PluginListenerHandle>


addListener('callAccepted', ...)

addListener(eventName: 'callAccepted', listenerFunc: (event: IncomingCallEvent) => void) => Promise<PluginListenerHandle>

Fired when the user accepts the call from native UI.

ParamType
eventName'callAccepted'
listenerFunc(event: IncomingCallEvent) => void

Returns: Promise<PluginListenerHandle>


addListener('callDeclined', ...)

addListener(eventName: 'callDeclined', listenerFunc: (event: IncomingCallEvent) => void) => Promise<PluginListenerHandle>

Fired when the user declines the call from native UI.

ParamType
eventName'callDeclined'
listenerFunc(event: IncomingCallEvent) => void

Returns: Promise<PluginListenerHandle>


addListener('callEnded', ...)

addListener(eventName: 'callEnded', listenerFunc: (event: IncomingCallEvent) => void) => Promise<PluginListenerHandle>

Fired when a call ends through the API or a platform action.

ParamType
eventName'callEnded'
listenerFunc(event: IncomingCallEvent) => void

Returns: Promise<PluginListenerHandle>


addListener('callTimedOut', ...)

addListener(eventName: 'callTimedOut', listenerFunc: (event: IncomingCallEvent) => void) => Promise<PluginListenerHandle>

Fired when an unanswered call reaches its configured timeout.

ParamType
eventName'callTimedOut'
listenerFunc(event: IncomingCallEvent) => void

Returns: Promise<PluginListenerHandle>


removeAllListeners()

removeAllListeners() => Promise<void>

Removes every native listener registered by the plugin.


Interfaces

ShowIncomingCallResult

Result payload for showIncomingCall().

PropTypeDescription
callIncomingCallRecordThe call record that was created or reused.

IncomingCallRecord

Represents a currently tracked call.

PropTypeDescription
callIdstringStable call identifier provided by your app.
callerNamestringName shown in the native UI.
handlestringSecondary handle shown by the platform when available.
hasVideobooleanWhether this call should be treated as a video call.
stateIncomingCallStateCurrent platform-reported call state.
platform'android' | 'ios' | 'web'Platform that produced the record.
extraRecord<string, any>Arbitrary metadata passed in at call creation time.

ShowIncomingCallOptions

Common options used to present an incoming call.

PropTypeDescription
callIdstringStable identifier for the call. Reuse the same value when ending the call later.
callerNamestringPrimary name shown to the user.
handlestringOptional secondary handle such as a phone number, SIP URI, or user ID.
appNamestringLabel shown by Android in notifications. iOS uses the app display name configured in the host app bundle.
hasVideobooleanWhether the incoming session should be marked as video-capable.
timeoutMsnumberBest-effort timeout in milliseconds. Defaults to 60000.
acceptTextstringCustom label for the accept action. Android only.
declineTextstringCustom label for the decline action. Android only.
extraRecord<string, any>Arbitrary JSON metadata echoed back in all events.
androidAndroidIncomingCallOptionsAndroid-specific behavior overrides.
iosIOSIncomingCallOptionsiOS-specific behavior overrides.

AndroidIncomingCallOptions

Android-specific incoming call presentation options.

PropTypeDescription
channelIdstringNotification channel identifier. Defaults to incoming_call_kit.
channelNamestringNotification channel display name. Defaults to Incoming Calls.
showFullScreenbooleanWhether Android should request full-screen presentation when possible. Defaults to true.
accentColorstringOptional accent color in #RRGGBB or #AARRGGBB form.
ringtoneUristringOptional ringtone URI string. Example: android.resource://com.example.app/raw/ringtone
isHighPrioritybooleanWhether to mark the notification as high priority. Defaults to true.

IOSIncomingCallOptions

iOS-specific incoming call presentation options.

PropTypeDescription
handleType'generic' | 'phoneNumber' | 'emailAddress'CallKit handle type. Defaults to generic.
supportsHoldingbooleanWhether the call should support hold. Defaults to true.
supportsDTMFbooleanWhether the call should support DTMF. Defaults to false.
supportsGroupingbooleanWhether the call should support grouping. Defaults to false.
supportsUngroupingbooleanWhether the call should support ungrouping. Defaults to false.

ActiveCallsResult

Result payload for getActiveCalls().

PropTypeDescription
callsIncomingCallRecord[]Calls still tracked by the native implementation.

EndCallOptions

Options for ending a single tracked call.

PropTypeDescription
callIdstringThe call identifier originally passed to showIncomingCall().
reasonstringOptional application-defined reason string.

EndAllCallsOptions

Options for ending all tracked calls.

PropTypeDescription
reasonstringOptional application-defined reason string.

IncomingCallPermissionStatus

Result payload for permission checks.

PropTypeDescription
notificationsPermissionState | 'notApplicable'Notification permission state. iOS CallKit itself does not require runtime notification permission, so iOS returns notApplicable.
fullScreenIntentPermissionState | 'notApplicable'Full-screen intent permission state. iOS returns notApplicable. Android 13 and below resolve this as granted.

PluginVersionResult

Plugin version payload.

PropTypeDescription
versionstringVersion identifier returned by the platform implementation.

PluginListenerHandle

PropType
remove() => Promise<void>

IncomingCallEvent

Payload delivered by plugin listeners.

PropTypeDescription
callIncomingCallRecordThe call that triggered the event.
reasonstringOptional reason for the state transition.
source'api' | 'user' | 'system'Origin of the action.

Type Aliases

IncomingCallState

Supported incoming call states.

'ringing' | 'accepted' | 'ended'

Record

Construct a type with a set of properties K of type T

{ [P in K]: T; }

PermissionState

'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'

版本与发布记录

@capgo/capacitor-incoming-call-kit 共发布 17 个版本,首次发布于 2026/03/31;过去 12 个月发布了 17 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
8.2.14latest2026/10/1525 天前
8.2.132026/10/1327 天前
8.2.122026/10/091 个月前
8.2.112026/10/081 个月前
8.2.92026/10/081 个月前
8.2.102026/10/081 个月前

关于 @capgo/capacitor-incoming-call-kit 的常见问题

@capgo/capacitor-incoming-call-kit 是什么?

Capacitor plugin for native incoming call UI with Android full-screen notifications and iOS CallKit.

如何安装 @capgo/capacitor-incoming-call-kit?

在项目目录运行 npm install @capgo/capacitor-incoming-call-kit,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@capacitor/core(>=8.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@capgo/capacitor-incoming-call-kit 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@capgo/capacitor-incoming-call-kit 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@capgo/capacitor-incoming-call-kit 可以商用吗?

@capgo/capacitor-incoming-call-kit 使用 MPL-2.0 许可。弱 Copyleft:可以商用,也可以和闭源代码一起使用;但如果分发时修改了 MPL 授权的文件,这些文件的修改需以 MPL 开源。以上为概括,不构成法律意见,请以许可原文为准。

@capgo/capacitor-incoming-call-kit 的下载量有多少?

根据 npm 官方下载统计,@capgo/capacitor-incoming-call-kit 在 2026/10/09 – 2026/11/07 这 30 天内被下载 5,911 次,日均约 197 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@capgo/capacitor-incoming-call-kit 还在维护吗?

最新版本 8.2.14 发布于 2026/10/15(25 天前);至今共发布 17 个版本,其中过去 12 个月发布了 17 个;首次发布于 2026/03/31。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。