You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Business context
Before going to the production with GetStream SDK, I need to have some business proof that calls change will be beneficial for users. We have 2 major issues with old implementation. One with Samsung Fold (already reported here ) and this issue with foreground service notification.
Describe the bug
Sometimes, when the application is in the background, incoming call is not shown.
Notification is missing, because Foreground service is not started.
Foreground service is not started, because app is in the background
Foreground service cannot be started from the background when there are some battery saving restrictions set for the app.
It's hard to recreate these restrictions set in natural way, because even when battery optimization is enabled for the specific app, it doesn't mean that it always will throw Exception when trying to start foreground service from the background. You would have to use other apps, and then android system see that you need system resources for other apps, and put your app into deep sleep.
When there is no optimization enabled at all - this bug also appears, but very rarely and it's very hard to reproduce, however on production with many users it appears hundreds times per week.
However don't worry, I have some hacks below 😄
SDK version
1.0.16
To Reproduce
Steps to reproduce the behavior:
Log In to some test user Thierry in demo-app on deviceA, and go into the background
Set background restrictions on deviceA using adb:
adb shell device_config put activity_manager \
default_fgs_starts_restriction_notification_enabled true
Go to the background on deviceA
It looks like you don't catch exception in your SDK, because i don't see any error in logcat, so you can think about adding it, and meanwhile you can observe the error using:
adb logcat -T 1 | grep ActivityManager
In logcat
5. Log In to some test user Alex in demo-app on deviceB and call Thierry
6. There is no incoming push notification on deviceA
Expected behavior
Incoming push notification should appear on deviceA
Suggestion regarding solution
You could detect whether starting foreground service for incoming call crashes, and then you can use normal push notification (without foreground service), and after clicking on notification and opening the app, you could ensure that foreground service is started - if it wasn't started already.
Device:
Android version: Any device with Android >= 12
The text was updated successfully, but these errors were encountered:
Thanks for letting us know.
We will look into your suggestion about improving the notification handling.
On the other hand we are working on integrating the telecom framework which will handle this part with the service / notification.
Business context
Before going to the production with GetStream SDK, I need to have some business proof that calls change will be beneficial for users. We have 2 major issues with old implementation. One with Samsung Fold (already reported here ) and this issue with foreground service notification.
Describe the bug
Sometimes, when the application is in the background, incoming call is not shown.
It's hard to recreate these restrictions set in natural way, because even when battery optimization is enabled for the specific app, it doesn't mean that it always will throw Exception when trying to start foreground service from the background. You would have to use other apps, and then android system see that you need system resources for other apps, and put your app into deep sleep.
When there is no optimization enabled at all - this bug also appears, but very rarely and it's very hard to reproduce, however on production with many users it appears hundreds times per week.
However don't worry, I have some hacks below 😄
SDK version
To Reproduce
Steps to reproduce the behavior:
Thierry
indemo-app
ondeviceA
, and go into the backgrounddeviceA
using adb:deviceA
In logcat
5. Log In to some test user
Alex
indemo-app
ondeviceB
and callThierry
6. There is no incoming push notification on
deviceA
Expected behavior
Incoming push notification should appear on
deviceA
Suggestion regarding solution
You could detect whether starting foreground service for incoming call crashes, and then you can use normal push notification (without foreground service), and after clicking on notification and opening the app, you could ensure that foreground service is started - if it wasn't started already.
Device:
The text was updated successfully, but these errors were encountered: