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
to determine whether we need to prompt the user to enable location services on the device. isGPSEnabled however returns a Promise, meaning the non-awaited returned value is always truthy, and therefore enableGPS will never actually actually prompt the user to enable location services, even if the promise returned by isGPSEnabled resolves to false
@delaneyb thanks for this. Tbh i dont use that part of the plugin. I always use the perms plugin and move the logic in the app. The reason is that the logic is constantly changing and getting more complex as new os versions are released
I even think of removing that part and let the user handles it with the perms plugin.
However if you want to make a PR to fix all this I would gladly merge it
enableGPS
uses the checkto determine whether we need to prompt the user to enable location services on the device.
isGPSEnabled
however returns aPromise
, meaning the non-awaited returned value is always truthy, and thereforeenableGPS
will never actually actually prompt the user to enable location services, even if the promise returned byisGPSEnabled
resolves tofalse
ble/src/ble/index.android.ts
Lines 1277 to 1300 in 9820235
A simple solution would be to make the promise constructor callback
async
and adjust the condition to:The check after receiving the request result from the system on line 1287 also needs to be corrected
ble/src/ble/index.android.ts
Line 1287 in 9820235
The text was updated successfully, but these errors were encountered: