1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00

Ask permission to use geo-location

This commit is contained in:
Laurent Cozic
2020-10-16 13:02:32 +01:00
parent 66059939a3
commit cfd63fe46f
4 changed files with 30 additions and 7 deletions

View File

@@ -3,7 +3,7 @@ const { Platform, PermissionsAndroid } = require('react-native');
type rationale = {
title: string,
message: string,
buttonPositive: string,
buttonPositive?: string,
buttonNegative?: string
buttonNeutral?: string
}
@@ -15,5 +15,5 @@ export default async (permissions: string, rationale?: rationale) => {
if (result !== PermissionsAndroid.RESULTS.GRANTED) {
result = await PermissionsAndroid.request(permissions, rationale);
}
return result === PermissionsAndroid.RESULTS.GRANTED;
return result;
};