Repository navigation
4.5.0
On Android, calls now outlive the app's activity, as in other calling apps: read the first Changed entry if your app relied on calls ending with it. Native code can now set CallKeep up and show calls on Android, and observe its events on iOS, before React Native runs.
Added
- Android:
foregroundService.foregroundServiceTypesets the types the foreground service starts with (Android 10 and later), as a mask ofServiceInfo.FOREGROUND_SERVICE_TYPE_*values. An app can ring withphoneCallalone while its manifest also declaresmicrophone; CallKeep keeps the types for the whole call, so addingmicrophoneafter the answer is up to the app's native code (see the option indocs/setup.md). Without the option, the service still starts with every type the manifest declares. - Android:
endCallsWhenReactNativeStops(defaulttrue): when React Native's instance stops while the app keeps running (a reload, an over-the-air update), CallKeep ends the calls, which no JavaScript handles any more. Set it tofalsewhen native code owns them. - Android:
RNCallKeepModule.setupNative(context, options)andRNCallKeepModule.displayIncomingCall(context, uuid, number, callerName, hasVideo)set CallKeep up and show an incoming call from native code, before React Native runs or without it (self-managed mode, Android 8 and later), for instance from a Firebase messaging service.VoiceConnectionService.nativeFocusListenerandhasConnectionServiceFocus()let native code follow Telecom's call focus (Android 9 and later). See Setup from native code (Android). - iOS: Events are also posted to
NotificationCenter, so native code can observe the call's actions before a React Native runtime exists. See Listening from native code (iOS).
Changed
- Android: Calls no longer end, and the app's process is no longer killed, when the React activity is destroyed: a configuration change the activity doesn't handle (font size, language), Back on Android 11 and earlier, or swiping the app away from Recents ended the call and closed the app. Calls go on, as in other calling apps, and end when the process dies (Telecom ends them) or when React Native's instance stops (
endCallsWhenReactNativeStops). Keep the call state and CallKeep's listeners outside your screens; see Calls and the app's lifecycle. - Docs: The Expo guide explains the config plugin's setup and what to add to it: the
audiobackground mode and microphone text on iOS; on Android, the foreground service permissions, without which Android 14 and later refuse CallKeep's foreground service, and thephoneCall|microphoneservice types;RECORD_AUDIOwith Expo SDK 54 and earlier. (#849, @sultanmyrza) - Docs: The API reference now lists
setSettings,setReachable,reportConnectingOutgoingCallWithUUID,reportConnectedOutgoingCallWithUUID(iOS) andunregisterAndroidEvents(Android), which were never documented. CI checks that every method matches acrossindex.js,index.d.tsand the API reference's table, and that the relative links in the docs resolve. - Docs: The iOS and Android installation guides are rewritten for autolinking: they still described
react-native linkand manual Xcode and Gradle steps from before React Native 0.60. They now follow the example app's setup, tested on devices: background modes, Recents and Siri (with or without scenes) and VoIP push on iOS; the manifest, foreground service types, runtime permissions, managed and self-managed modes on Android. - Docs: The README is now short (what the library does, compatibility, installation, a quick start), and the documentation moved to
docs/: setup and options, the API reference, events, guides (calls when the app isn't running, Android self-managed mode, the iOS 27 scene life cycle, Expo), troubleshooting and the migration guides. Fixed on the way: the method table's return types (most call methods return nothing, not a promise), missing methods (sendDTMF,getAudioRoutes,setAudioRoute), theCONSTANTSimport example, theforegroundServiceandnotificationIconoptions, the claim that self-managed mode needsREAD_CALL_LOG(the library doesn't use it), and the claim that nothing works on emulators (Android emulators do).
Fixed
- iOS:
setup()applies its options to CallKit right away. When the app had run before, CallKit kept the options of the previous launch (the module builds the CallKit provider from the stored settings when it loads), and callingsetup()again didn't change them either. An app that sets up from native code can now call[RNCallKeep setup:]again to change them;setup()from JavaScript is still ignored then, as documented. (#732, @c960657) - Android: The foreground service keeps the importance and sound of the notification channel named by
foregroundService.channelIdwhen that channel already exists; its name still followschannelName. An app could pass its own channel, such as the one its incoming calls ring in: creating it again withIMPORTANCE_NONElowered its importance (from high to low on a Galaxy S24, Android 16), and its notifications stopped alerting. - Android: A call created in a process where the CallKeep module doesn't exist gets its foreground service. The service read the stored settings only through the module: a call placed from the Phone app while the app isn't running started no foreground service, and an incoming call added from native code, whose connection loads the settings, crashed the app with a
NullPointerException. Without the module, the notification opens no activity. - Android:
checkIsInManagedCall(),setAudioRoute()andtoggleAudioRouteSpeaker()no longer crash the app on Android 7 withNoSuchMethodError: they called Android 8 APIs. Before Android 8,checkIsInManagedCall()reports any ongoing call (there are no self-managed calls then),setAudioRoute()rejects andtoggleAudioRouteSpeaker()does nothing. - Android:
setAudioRoute()rejects when no call has the given UUID. Its promise never settled. - Android: Android lint passes on the library (#646):
startCallandcheckDefaultPhoneAccounthandle aSecurityExceptionfrom Telecom (a permission can be revoked at any time),endCallusesAudioManager.MODE_NORMAL, and the library'sbuild.gradleno longer declares the Android Gradle Plugin 3.0.1: the app's plugin builds it. (#684, @ramijarrar) - Android:
backToForeground()on a locked device asks the user to unlock (Android 8 and later), then shows the app. The app used to come to the front behind the lock screen: the window flags meant to show it over the lock screen were added to the intent, where the same values mean other intent flags (FLAG_ACTIVITY_NEW_DOCUMENT,FLAG_ACTIVITY_RESET_TASK_IF_NEEDED,FLAG_ACTIVITY_BROUGHT_TO_FRONT). (#684, @ramijarrar) - Android:
didDisplayIncomingCallis sent for calls shown withdisplayIncomingCall, once Telecom has created the call, as on iOS. It was only sent by the nativereportNewIncomingCall, right away, even when the call was then refused or ignored. Its fields now follow the documentation:localizedCallerName(nameis kept),hasVideoas"1"or"0"(it was"true"or"false"),fromPushKitas"0", and thepayloadofreportNewIncomingCallor of the nativedisplayIncomingCall. (#672, @RamsayRomero; fixes #671) - The npm package no longer includes the release notes file (
notes.md) and an IntelliJ project file (android/react-native-callkeep.iml), which 4.4.0 shipped by mistake.