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.
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.