# react-native-webrtc/react-native-callkeep architecture

> Architecture diagram of the GitHub repository react-native-webrtc/react-native-callkeep, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/react-native-webrtc/react-native-callkeep
- Repository: https://github.com/react-native-webrtc/react-native-callkeep

## Overview

React Native CallKeep bridges a VoIP app to iOS CallKit and Android Telecom, letting the operating system present and manage calls while call actions and audio events return to JavaScript. The main path is app API → native module → platform call framework, with events dispatched back through the bridge. README capabilities include self-managed Android calls, conferencing, PushKit incoming calls, and foreground operation. Android excerpts support service/connection dispatch details; iOS implementation and several documented branches are represented only at their documented boundary.

Main entry points: [`android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java`](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java) (Connection service), [`ios/RNCallKeep/RNCallKeep.m`](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/ios/RNCallKeep/RNCallKeep.m) (iOS bridge), [`android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java`](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java) (Android bridge), [`index.js`](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/index.js) (CallKeep API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_js["JavaScript API"]
  node_api["CallKeep API<br/>[index.js]"]
  node_events["Event adapters<br/>[actions.js]"]
end

subgraph group_android["Android runtime"]
  node_android_module["Android bridge"]
  node_connection_service["Connection service"]
  node_connection["Call connection"]
  node_conference["Call conference"]
  node_background["Headless handler"]
end

subgraph group_ios["iOS runtime"]
  node_ios_module["iOS bridge<br/>[RNCallKeep.m]"]
  node_ios_header["CallKit interface<br/>[RNCallKeep.h]"]
end

subgraph group_integrations["Call integrations"]
  node_telecom["Android Telecom"]
  node_callkit["Apple CallKit"]
  node_pushkit["PushKit provider"]
  node_audio["Native audio session"]
  node_accounts["Phone account settings"]
end

node_voip(("VoIP application"))

node_voip -->|"calls"| node_api
node_api -->|"invokes native"| node_android_module
node_api -->|"invokes native"| node_ios_module
node_api -->|"registers listeners"| node_events
node_android_module -->|"configures calls"| node_connection_service
node_telecom -->|"requests connections"| node_connection_service
node_connection_service -->|"creates connection"| node_connection
node_connection_service -->|"creates conference"| node_conference
node_connection -->|"broadcasts actions"| node_connection_service
node_connection_service -->|"dispatches events"| node_android_module
node_android_module -->|"emits events"| node_events
node_connection_service -.->|"starts headless task"| node_background
node_android_module -->|"opens settings"| node_accounts
node_ios_module -->|"controls calls"| node_callkit
node_ios_header -->|"declares interface"| node_ios_module
node_callkit -->|"delivers call actions"| node_ios_module
node_ios_module -->|"emits events"| node_events
node_pushkit -.->|"reports incoming call"| node_ios_module
node_callkit -->|"activates audio"| node_audio

click node_api "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/index.js"
click node_events "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/actions.js"
click node_android_module "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java"
click node_connection_service "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java"
click node_connection "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConnection.java"
click node_conference "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConference.java"
click node_background "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/RNCallKeepBackgroundMessagingService.java"
click node_ios_module "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/ios/RNCallKeep/RNCallKeep.m"
click node_ios_header "https://github.com/react-native-webrtc/react-native-callkeep/blob/master/ios/RNCallKeep/RNCallKeep.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_api,node_events toneBlue
class node_android_module,node_connection_service,node_connection,node_conference,node_background toneAmber
class node_ios_module,node_ios_header toneMint
class node_telecom,node_callkit,node_pushkit,node_audio,node_accounts toneRose
class node_voip toneIndigo
```

## Components

### JavaScript API

- [CallKeep API](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/index.js): `index.js`
- [Event adapters](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/actions.js): `actions.js`

### Android runtime

- [Android bridge](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java): `android/src/main/java/io/wazo/callkeep/RNCallKeepModule.java`
- [Connection service](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java): `android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java`
- [Call connection](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConnection.java): `android/src/main/java/io/wazo/callkeep/VoiceConnection.java`
- [Call conference](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/VoiceConference.java): `android/src/main/java/io/wazo/callkeep/VoiceConference.java`
- [Headless handler](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/android/src/main/java/io/wazo/callkeep/RNCallKeepBackgroundMessagingService.java): `android/src/main/java/io/wazo/callkeep/RNCallKeepBackgroundMessagingService.java`

### iOS runtime

- [iOS bridge](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/ios/RNCallKeep/RNCallKeep.m): `ios/RNCallKeep/RNCallKeep.m`
- [CallKit interface](https://github.com/react-native-webrtc/react-native-callkeep/blob/master/ios/RNCallKeep/RNCallKeep.h): `ios/RNCallKeep/RNCallKeep.h`

### Call integrations

- **Android Telecom**
- **Apple CallKit**
- **PushKit provider**
- **Native audio session**
- **Phone account settings**

### Other components

- **VoIP application**

## Connections

- VoIP application → CallKeep API: calls
- CallKeep API → Android bridge: invokes native
- CallKeep API → iOS bridge: invokes native
- CallKeep API → Event adapters: registers listeners
- Android bridge → Connection service: configures calls
- Android Telecom → Connection service: requests connections
- Connection service → Call connection: creates connection
- Connection service → Call conference: creates conference
- Call connection → Connection service: broadcasts actions
- Connection service → Android bridge: dispatches events
- Android bridge → Event adapters: emits events
- Connection service → Headless handler: starts headless task
- Android bridge → Phone account settings: opens settings
- iOS bridge → Apple CallKit: controls calls
- CallKit interface → iOS bridge: declares interface
- Apple CallKit → iOS bridge: delivers call actions
- iOS bridge → Event adapters: emits events
- PushKit provider → iOS bridge: reports incoming call
- Apple CallKit → Native audio session: activates audio
