ably / ably-flutter

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.
https://ably.com/download
Apache License 2.0
60 stars 16 forks source link

Is there a way to respond to Android device battery optimization settings? #513

Closed walkerJung closed 6 months ago

walkerJung commented 6 months ago

On Android devices

Settings Menu -> Application Menu -> Select My App -> Battery Menu

If you go into the menu, there are no restrictions, optimization, and restrictions I think it's usually set to optimization.

If it's set up like this, the network is disconnected when the app goes to the background, is there a way to respond in ably in this case?

┆Issue is synchronized with this Jira Task by Unito

sacOO7 commented 6 months ago

I think library does listen to network state change events => https://github.com/ably/ably-java/blob/main/android/src/main/java/io/ably/lib/platform/AndroidNetworkConnectivity.java. That's why ably goes into disconnected state.

walkerJung commented 6 months ago

@sacOO7 I think that's correct. If I fix this, I think I can use it on Android devices without any problems. Thank you so much for your kind answers and guidance