Skip to content

Commit e3625f5

Browse files
committed
fix(android): location permission was always returned granted
1 parent 08669b3 commit e3625f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ble/index.android.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,15 +1222,15 @@ export class Bluetooth extends BluetoothCommon {
12221222
// location permission not needed anymore
12231223
return true;
12241224
}
1225-
return check('location', { coarse: false, precise: true }).then((r) => r[1]);
1225+
return check('location', { coarse: false, precise: true }).then((r) => r[0] === 'authorized');
12261226
}
12271227

12281228
async requestLocationPermission() {
12291229
if (sdkVersion >= 31) {
12301230
// location permission not needed anymore
12311231
return true;
12321232
}
1233-
return request('location', { coarse: false, precise: true }).then((r) => r[1]);
1233+
return request('location', { coarse: false, precise: true }).then((r) => r[0] === 'authorized');
12341234
}
12351235
async isGPSEnabled() {
12361236
if (sdkVersion >= 31) {

0 commit comments

Comments
 (0)