mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-15 09:04:04 +02:00
10 lines
337 B
TypeScript
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;
|
|
};
|