Skip to content
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

fix: crash on app start when permission is denied #304

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

g4rb4g3
Copy link

@g4rb4g3 g4rb4g3 commented Mar 22, 2024

Overview

This PR fixes a crash when starting an app using this library and denying the location permission.
Instead of throwing an exception on native side that is not handled it will emit the error to rn so it can be handled properly there.

Test Plan

Call Geolocation.watchPosition and deny the permission -> without this PR the app will crash.
java.lang.SecurityException GeolocationModule.java:142 Looks like the app doesn't have the permission to access location. Add the following line to your app's AndroidManifest.xml: <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
With this PR the error callback is triggered and the missing permission can be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant