-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: Plugin does not cause app to exit when the user removes required permissions #199
Comments
I would advise to run the scenario in a simulator or app in debug mode and look at the logcat to see where the exception is raised. |
Thanks I will have a go at that. |
I was able to capture the exception from logcat:
I am not a native app developer, so if anyone has any tips on where I need to look or how to try and prevent the exception from crashing the app that would be great. |
I'm thinking maybe we can put this line in a try/catch but I'm not sure of any negative implications of doing that. |
You should be able to create a fork, update the code and use it using npm install<your-repo.git>. |
HaylLtd#199 If an exception is raised when starting the foreground service this causes the app to crash. One cause of exceptions can be if the user revokes the location or notification permissions whilst the foreground service is running.
I tried to make this change to prevent the exception but it didn't work. Here is the stacktrace after the change:
I have very little experience with native code, so I don't know what to try next. |
Try cloude, maybe it can help... |
Facing a similar issue that causes crashes at startup, looks like the most relevant part of the logs is:
After investigations, it's related to the account sync code, which requires permissions. So the next question is: Is this sync useful ? Could anyone confirm? |
I'm the main maintainer (almost the only one), and I don't know what this is needed for. but the app does persist locations to an sqlite database on Android. |
FEATURE REQUEST
Is your feature request related to a problem? Please describe.
On Android 14 if the user removes the location or notification permissions whilst the plugin is running, the app exits immediately. I guess it is crashing due to some unhandled exception.
Describe the solution you'd like
It would be really nice if the plugin could handle this scenario more gracefully. It would be good if the tracking just stopped without causing the app to exit. I am using another plugin to monitor the permissions that the user has granted and I would like to use this to capture when the user disabled the location or notification permission and then log that in the app. But because the app just exits I am unable to accomplish this aim.
Describe alternatives you've considered
I tried looking at the debug logs but could not find any exceptions being raised when the app exits. Otherwise I would have liked to suggest a solution for the problem.
Additional context
None
The text was updated successfully, but these errors were encountered: