Skip to content

5.1.0

Latest

Choose a tag to compare

@cometchat cometchat released this 29 Oct 17:31
· 1 commit to v5 since this release
7c7aa4f

v5.1.0

New

  • Added the call lifecycle APIs from the native Calls SDK 5.1: initiateCall, endCall, getActiveSession, injectIncomingCall and injectIncomingCallEnded, with IncomingCallListener, InitiateCallOptions, InitiatedCall, PrepareStatus, SessionState, EndCallStatus, CallType and ReceiverType. 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() and getPrepareError() to CallSession.
  • Added the onConnected and onParticipantConnected session events, which fire while a session is prepared and before the user joins.
  • Added SessionSettingsBuilder.setPeerCall for 1:1 calls.
  • Added CometChatCalls.notifyCallKitAudioActivated() and notifyCallKitAudioDeactivated() for iOS apps and push SDKs that own the CXProvider: call them from provider(_:didActivate:) and provider(_: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 the CallSession with 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() and disablePictureInPictureLayout() should remove those calls.
  • Changed the Android ongoing call service to also use the mediaPlayback foreground service type when the app declares it and holds FOREGROUND_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_stripe or 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 onSessionLeft not 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(). Use leave() instead.
  • Deprecated CallSession.isCallSessionActive. Use isSessionActive() 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 install stops 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_plus 7.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 hold connectivity_plus at 7.0.x in its own pubspec.yaml ('>=7.0.0 <7.1.0').
  • Android apps need Android Gradle Plugin 8.9.1 or later and compileSdk 36, through connectivity_plus 7 and androidx.core 1.18. Flutter 3.44's default compileSdk is 36.
  • Apps that implements SessionStatusListeners or ParticipantEventListeners must add the new onConnected or onParticipantConnected method, or extends the 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.connect to report a CallSession instead of a String status, as the native SDKs do. The old status is session.getPrepareStatus().
  • Changed CometChatCalls.endCall to report no data, and removed EndedCall. The native SDKs no longer return a body from endCall.