You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I noticed some weird behavior in Android when using getCurrentPosition() method with a timeout and providing coarse location permission only.
Your Environment
Plugin version: 4.16.2
Platform: Android
OS version: 12
Device manufacturer / model: Google Pixel 3a
React Native version (react-native -v): 0.72.4
Plugin config
BackgroundGeolocation.getCurrentPosition({timeout: 5,samples: 3,desiredAccuracy: 50// even using 100000 the result is the same}).then((position)=>{console.log(JSON.stringify(position,null,2))}).catch((e)=>{console.error(e)})
Expected Behavior
I expect getCurrentPosition() to ask user coarse or fine location permissions the first time it is invoked.
Since providing coarse position permission is enough for the first call, I expect it to be enough even for the further ones, without asking user to provide fine location (maybe such a behavior should be controlled by a flag or something in the request params).
Actual Behavior
When invoking getCurrentPosition() for the first time, if user only grants coarse location permission, location is returned. Invoking getCurrentPosition() again, a native alert appears asking user to provide fine location.
Moreover, if a timeout is provided, the popup is displayed but a location is returned before user actually chooses to provide fine one or not, making the fine permission request irrelevant.
Steps to Reproduce
Invoke getCurrentPosition()
Grant coarse location permission only
Invoke getCurrentLocation() again
Just wait without closing the native dialog
Context
I want to ask user location accuracy only once, if at least coarse location permission is provided
Debug logs
Logs
PASTE_YOUR_LOGS_HERE
The text was updated successfully, but these errors were encountered:
.getCurrentPosition always uses highest possible accuracy.
the options.desiredAccuracy has a different meaning with .getCurrentPosition — it means the accuracy you’ll be satisfied with when providing options.samples, where if a location having accuracy <= options.desiredAccuracy arrives, the method will stop further sampling and deliver that location.
Hi,
I noticed some weird behavior in Android when using getCurrentPosition() method with a timeout and providing coarse location permission only.
Your Environment
react-native -v
): 0.72.4Expected Behavior
I expect getCurrentPosition() to ask user coarse or fine location permissions the first time it is invoked.
Since providing coarse position permission is enough for the first call, I expect it to be enough even for the further ones, without asking user to provide fine location (maybe such a behavior should be controlled by a flag or something in the request params).
Actual Behavior
When invoking getCurrentPosition() for the first time, if user only grants coarse location permission, location is returned. Invoking getCurrentPosition() again, a native alert appears asking user to provide fine location.
Moreover, if a timeout is provided, the popup is displayed but a location is returned before user actually chooses to provide fine one or not, making the fine permission request irrelevant.
Steps to Reproduce
Context
I want to ask user location accuracy only once, if at least coarse location permission is provided
Debug logs
Logs
The text was updated successfully, but these errors were encountered: