Skip to content

Commit ba031c0

Browse files
authored
fix(llc): fixed foreground service being recreated when declining the call (#764)
* fixed foreground service recreation when declining the call * changelog
1 parent 20a9aa2 commit ba031c0

File tree

5 files changed

+14
-1
lines changed

5 files changed

+14
-1
lines changed

packages/stream_video/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 0.5.4
22

3+
🐞 Fixed
4+
* Fixed an issue where active call foreground service was recreated after being stopped when ringing call was declined and in-app incoming screen was displayed.
5+
36
🚧 Breaking changes
47
* The regular push notification handling has been removed from iOS, providing more control over the implementation. VoIP push notifications will continue to be handled as before. For more details, refer to the documentation.
58

packages/stream_video_flutter/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## 0.5.4
22

3+
🐞 Fixed
4+
* Fixed an issue where active call foreground service was recreated after being stopped when ringing call was declined and in-app incoming screen was displayed.
5+
36
🚧 Breaking changes
47
* The regular push notification handling has been removed from iOS, providing more control over the implementation. VoIP push notifications will continue to be handled as before. For more details, refer to the documentation.
58

packages/stream_video_flutter/android/src/main/kotlin/io/getstream/video/flutter/stream_video_flutter/service/ServiceManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class ServiceManagerImpl(
8484
}
8585

8686
/**
87-
* Start the foreground service.
87+
* Stop the foreground service.
8888
*/
8989
override fun stop(type: ServiceType): Boolean {
9090
logger.d { "[stop] type: $type" }

packages/stream_video_flutter/lib/src/call_background/background_service.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,12 @@ class StreamBackgroundService {
238238
NotificationOptionsBuilder optionsBuilder,
239239
) {
240240
return call.state.listen((value) async {
241+
_logger.v(() => '[listenState] call service update, state: $value');
242+
243+
if (value.status is CallStatusDisconnected) {
244+
return;
245+
}
246+
241247
try {
242248
final result = await StreamVideoFlutterBackground.updateService(
243249
NotificationPayload(

packages/stream_video_flutter/lib/stream_video_flutter_background.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ mixin StreamVideoFlutterBackground {
3434
if (!isAndroid) {
3535
return false;
3636
}
37+
3738
return StreamVideoFlutterPlatform.instance.updateBackgroundService(
3839
payload: options,
3940
type: type,

0 commit comments

Comments
 (0)