CSharpShellApp icon indicating copy to clipboard operation
CSharpShellApp copied to clipboard

Background service question

Open sedoLevi609 opened this issue 2 years ago • 4 comments

Is there any way to create a service in the background with C# Shell as Maui project,that is still running even after app is killed? If it's possible, how?

sedoLevi609 avatar Feb 21 '23 17:02 sedoLevi609

Ui.StartService method might do it. However the success will vary from Android versions and manufacturers. Make sure to disable battery optimizations or whatever the manufacturer named it for said app or the app will be killed pretty fast when it goes in the background.

radimitrov avatar Feb 22 '23 12:02 radimitrov

But the service will still running with Ui.StartService in the background after app is closed?

sedoLevi609 avatar Feb 22 '23 12:02 sedoLevi609

Not certain. I'll make sure the service methods themselves work, the rest is up to the OS configuration

radimitrov avatar Feb 22 '23 13:02 radimitrov

@radimitrov How can I use Intent argument in Ui.StartService(it only accepts string)?

sedoLevi609 avatar Feb 22 '23 15:02 sedoLevi609