Description
- I have reviewed the documentation
- I have searched existing issues
- I am using the latest React Native version
I seen this had already been reported #13920 but had been closed so reopening this.
The dialog produced when requesting permissions isn't user friendly. There's no option to dismiss the dialog and so may seem confusing to the users.
An quick fix would be to include a dismiss button automatically but an additional field along with 'title' and 'message' called 'button' would be great for having custom text in the button.
Environment
Environment:
OS: Linux 4.4
Node: 9.4.0
Yarn: Not Found
npm: 5.8.0
Watchman: Not Found
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: ^16.0.0-beta.5 => 16.0.0-beta.5
react-native: ^0.50.4 => 0.50.4
Steps to Reproduce
Add the following function to your project and call it.
async function requestPermission() {
if (Platform.OS === "ios") {
return true;
}
try {
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
{
title: "Enable Permission",
message:
"Message here"
}
);
switch (granted) {
case PermissionsAndroid.RESULTS.GRANTED:
return true;
case PermissionsAndroid.RESULTS.DENIED:
return false;
case PermissionsAndroid.RESULTS.NEVER_ASK_AGAIN:
await doAlert(neverAskAgainTitle, neverAskAgainMessage);
return false;
}
} catch (e) {
console.log(e);
// fall through
}
return false;
}
Expected Behavior
Expected the dialog to include a dismiss button so they can get to the actual permission dialog.