Closed rena821 closed 9 months ago
You should ensure that any permissions required by the accessibility service are requested within your app's main activity. Once the necessary permissions are granted, you can then perform the desired actions within the foreground service.
All the required permissions are granted. I tested it and it works very well when I call the FlutterAccessibilityService.accessStream.listen((event)
. But as soon as I call it from a foreground service I get the error mentioned above.
Can you try the latest version of the package
I am experimenting with using the flutter accessiblity service from a flutter foreground task. When I try to listen to the events in the foreground task then I get the following exception if the app is closed:
It is probably because the package is trying to use an Activity context to call startActivityForResult. But this context may not be available in a foreground service.
Is there a way to use it from a foreground service?