Skip to main content
Keep calls alive when users navigate away from your app. Background handling ensures the call continues running when users press the home button, switch to another app, or lock their device.

Overview

When a user leaves your call activity, Android may terminate it to free resources. The SDK provides CometChatOngoingCallService - a foreground service that:
  • Keeps the call session active in the background
  • Shows an ongoing notification in the status bar
  • Allows users to return to the call with a single tap
  • Provides a hangup action directly from the notification

When to Use

Background Handling is different from VoIP Calling. VoIP handles receiving calls when the app is not running. Background Handling keeps an active call alive when the user leaves the app.

Implementation

Step 1: Add Manifest Permissions

Add the required permissions and service declaration to your AndroidManifest.xml:

Step 2: Start Service on Session Join

Start the ongoing call service when the user successfully joins a call session:

Custom Notification

Customize the ongoing call notification to match your app’s branding:
The notification channel ID must be CometChat_Call_Ongoing_Conference to work with the SDK’s service.

Complete Example


API Reference

CometChatOngoingCallService

OngoingNotification