Skip to content

Commit

Permalink
fix(android): location permission was always returned granted
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed Jan 11, 2024
1 parent 08669b3 commit e3625f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ble/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1222,15 +1222,15 @@ export class Bluetooth extends BluetoothCommon {
// location permission not needed anymore
return true;
}
return check('location', { coarse: false, precise: true }).then((r) => r[1]);
return check('location', { coarse: false, precise: true }).then((r) => r[0] === 'authorized');
}

async requestLocationPermission() {
if (sdkVersion >= 31) {
// location permission not needed anymore
return true;
}
return request('location', { coarse: false, precise: true }).then((r) => r[1]);
return request('location', { coarse: false, precise: true }).then((r) => r[0] === 'authorized');
}
async isGPSEnabled() {
if (sdkVersion >= 31) {
Expand Down

0 comments on commit e3625f5

Please sign in to comment.