Have you tried with foreground service
What is the proper way to restart hybrid service when app gets killed ?
I've been developing chat app with Xamarin.Android, using hybrid service (Started + Binded) with STICKY. App basically using Signalr hubconnection inside service. Problem is some device vendors killing app service as app goes background. Giving one of following reason for service kill
-- app was idle
-- MIUILog AppServiceRestart rejected
I've also tried disabling battery optimizations and toggled AutoStart. Nothing works ! I know popular messenger apps are by default allowed by device vendors to run without issue.
Is there any way I can keep my service from getting killed or at least restart it as soon as it gets killed without having user to change system settings ?
Thanks !
2 answers
Sort by: Most helpful
-
-
Alessandro Caliaro 4,186 Reputation points
2020-12-06T08:11:45.35+00:00 I think is the only possibility without to be a system app