I am using sockets for android real time push notifications, but the trouble is here, In android 8.0 or higher when app is killed , then socket is disconnected, however we achieved connection alive with foreground notification, but ideal user wont be happy with that, is there any solution so that I can run sockets in background or hide foreground notification ? (I dont want to use FCM notifications for some reasons), however I can use job schedulers or workers but there will be atleast 15minutes delay which is not real time
Asked
Active
Viewed 168 times
1 Answers
1
Using broadcast and service together are a good solution for your problem they can call and run even when your app killed
Just check the below link, I hope that it might help you :
How to keep a CountDownTimer running even if the app is closed? https://stackoverflow.com/a/32028234/7485788

Sina Mirshafiei
- 312
- 1
- 4
- 15