1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00
joplin/ReactNativeClient/lib/checkPermissions.ts

10 lines
337 B
TypeScript

const { PermissionsAndroid } = require('react-native');
export default async (permissions: string) => {
let result = await PermissionsAndroid.check(permissions);
if (result !== PermissionsAndroid.RESULTS.GRANTED) {
result = await PermissionsAndroid.request(permissions);
}
return result === PermissionsAndroid.RESULTS.GRANTED;
};