Repository navigation
v5.1.0
New
- Added the call lifecycle APIs from the native Calls SDK 5.1:
initiateCall,endCall,getActiveSession,injectIncomingCallandinjectIncomingCallEnded, withIncomingCallListener,InitiateCallOptions,InitiatedCall,PrepareStatus,SessionState,EndCallStatus,CallTypeandReceiverType. On Android and iOS each runs the native method of the same name, so calls ring and are prepared while they ring, and answering joins almost immediately. - Added
leave(),isSessionJoined(),isSessionActive(),getSessionId(),getCallToken(),getPrepareStatus()andgetPrepareError()toCallSession. - Added the
onConnectedandonParticipantConnectedsession events, which fire while a session is prepared and before the user joins. - Added
SessionSettingsBuilder.setPeerCallfor 1:1 calls. - Added
CometChatCalls.notifyCallKitAudioActivated()andnotifyCallKitAudioDeactivated()for iOS apps and push SDKs that own theCXProvider: call them fromprovider(_:didActivate:)andprovider(_:didDeactivate:)to hand the audio session to WebRTC. They do nothing on Android and web. - Added an example app that initialises the SDK, logs a user in and joins a session.
Enhancements
- Moved to the native Calls SDK 5.1.0 on Android and iOS, and to the JavaScript Calls SDK 5.1.0 on web.
- Changed
connect()to run on web as well, returning theCallSessionwith the same prepare status the native platforms report.getCallToken()is null on web. - Improved Picture-in-Picture on Android: the plugin switches the call to the PiP layout when the app enters PiP and back when the window expands, and closing the PiP window keeps the call running with this user's video paused until the app is on screen again. Apps only decide when to enter PiP; apps that switched the layout themselves with
enablePictureInPictureLayout()anddisablePictureInPictureLayout()should remove those calls. - Changed the Android ongoing call service to also use the
mediaPlaybackforeground service type when the app declares it and holdsFOREGROUND_SERVICE_MEDIA_PLAYBACK, so a call answered with the microphone denied keeps its notification. - Removed the Firebase configuration files and internal release scripts that previous versions shipped in the package.
Fixes
- Fixed Android release builds failing with "Type com.facebook.react.bridge.Callback is defined multiple times" in apps that also use
flutter_stripeor another package with React Native class names. The native SDK now ships its React Native runtime under its own package names. - Fixed the app being killed on Android when a call was answered with the microphone permission denied.
- Fixed iOS voice calls switching to the loudspeaker right after joining.
- Fixed
onSessionLeftnot reaching the app on iOS when the call was ended from this device, which left the "session has ended" view on screen. - Fixed a listener that removed itself while being notified, for example on
onParticipantJoined, stopping the event from reaching the listeners after it. - Fixed the iOS join reliability fixes of 5.0.10 not applying to the native 5.1 join: a join that fails or does not complete within 30 seconds reaches
onError, a join interrupted by a brief network drop is retried, and rebuilding the call widget no longer ends the call.
Deprecations
- Deprecated
CallSession.leaveSession(). Useleave()instead. - Deprecated
CallSession.isCallSessionActive. UseisSessionActive()instead.
Breaking Changes
- iOS builds with Swift Package Manager only. The native Calls SDK 5.1 is published as a Swift package, not on the CocoaPods trunk. Swift Package Manager is on by default from Flutter 3.44; otherwise run
flutter config --enable-swift-package-manager. If it is off,pod installstops with these steps. - Android apps declare the ongoing call service. The plugin no longer declares it, so the app chooses the foreground service types it can justify on Google Play. Apps upgrading from 5.0.x must add it inside
<application>; without it, Android stops the microphone and camera when the app goes to the background:<service android:name="com.cometchatcalls.cometchatcalls_plugin.services.OngoingCallService" android:exported="false" android:foregroundServiceType="microphone|camera" />
- iOS apps build with Xcode 26.1.1 or later, through
connectivity_plus7.1+, which uses the iOS 26 SDK. With Xcode 16 the build fails with "Value of type 'NWPath' has no member 'isUltraConstrained'". An app that must build with Xcode 16 can holdconnectivity_plusat 7.0.x in its ownpubspec.yaml('>=7.0.0 <7.1.0'). - Android apps need Android Gradle Plugin 8.9.1 or later and
compileSdk36, throughconnectivity_plus7 andandroidx.core1.18. Flutter 3.44's defaultcompileSdkis 36. - Apps that
implementsSessionStatusListenersorParticipantEventListenersmust add the newonConnectedoronParticipantConnectedmethod, orextendsthe class instead. Dart requires a class that implements another to define all of its members, so these apps no longer compile until they do. - Changed
CometChatCalls.connectto report aCallSessioninstead of aStringstatus, as the native SDKs do. The old status issession.getPrepareStatus(). - Changed
CometChatCalls.endCallto report no data, and removedEndedCall. The native SDKs no longer return a body fromendCall.