Improve the behaviour of StreamCallActivity when the call has been declined - #1478
Merged
Conversation
UseCase: Ios is making a group call with 2 android users and one of the android user will decline
Contributor
SDK Size Comparison 📏
|
rahul-lohra
marked this pull request as ready for review
July 23, 2025 08:15
aleksandar-apostolov
approved these changes
Jul 23, 2025
Pending: This is not backward compatible yet
|
StreamCallActivity when the call has been declined
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


🎯 Goal
StreamCallActivityreject apicall lifecycle scope1. Improve Inconsistent Call Screen Behavior on Decline
Setup:
iOS user (A) initiates a group call to two Android users: (B) and (C).
The call enters the Ringing state on both Android devices.
Issue:
User B declines the call.
❌ Problem: Despite declining, User B remains stuck on the clling screen, with the progress bar still visible.
✅ Expected behavior: User B should be navigated back to the main activity immediately after declining.
Later, User C also declines the call.
✅ Now, User B is finally redirected back to the main screen, even though they had already declined earlier.
Conclusion:
There seems to be a UI or state handling issue where the call screen doesn't dismiss immediately after a decline unless all recipients decline.
🛠️ Problem
The existing approach for loading
StreamCallActivityConfigurationwas flawed.The configuration was being initialized via a public
val:This was accessed during the activity's construction phase, before
onCreatewas invoked.As a result,
intentwasnullwhen the configuration was read, leading to incorrect or default behavior.✅ Solution
To resolve this issue:
onCreate()by reading from the intent.singleToporsingleTasklaunch modes, configuration is also re-initialized inonNewIntent().@Deprecated( message = "Accessing configuration before onCreate may lead to unintended behavior. Use config instead.", replaceWith = ReplaceWith("getConfiguration()") ) open val configuration: StreamCallActivityConfiguration @Deprecated("Use configurationMap instead", replaceWith = ReplaceWith("configurationMap"), level = DeprecationLevel.WARNING) protected lateinit var config: StreamCallActivityConfiguration private set🆕 Updated API
Use this variable instead:
onCreate()or after callinginitializeConfig(intent).Additionally:
And
🔁 Migration Notes
configuration&configwithconfigurationMapimplementations.initializeConfig(intent)in youronCreate()andonNewIntent()methods.2. Avoid double finish of
StreamCallActivityWe introduce a new API named
safeFinishwhich should be invoked when we want to finish theStreamCallActivityactivityfinish()invocation3. Improve
reject apicall lifecycle scopeThe
reject API, when invoked fromStreamCallActivity, operates in a broader scope than the activity itself. This is because there are scenarios where the activity is finished regardless of whether the network call succeeds or fails.4. Allow the client to handle when there is an incoming call while the user is already in a call
We introduce an interface named
IncomingCallHandlerDelegatewhich will allow the integrators to handle this caseIntegrators can implement their handling of
IncomingCallHandlerDelegateviaThe SDK has default implementation of it in which, we are rejecting the current call first then accepting the incoming call within the same activity
Its implementation
We improved the error handling in
StreamCallActivityas this activity can have more than 1 call (1 active call + 1 incoming call). So theExceptioninonErrorFinishwill beStreamCallActivityExceptionfrom this version in a Non-breaking way)🎨 UI Changes
Add relevant screenshots
Add relevant videos