Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PermissionsAndroid request - missing dismiss button for initial dialog (or custom buttons) #19327

Closed
2 of 3 tasks
MarkOSullivan94 opened this issue May 17, 2018 · 5 comments
Closed
2 of 3 tasks
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.

Comments

@MarkOSullivan94
Copy link

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.

Actual Behavior

Dialog produced shown below.
screenshot_1526551341

@MarkOSullivan94 MarkOSullivan94 changed the title [android] PermissionsAndroid request - missing dismiss button for initial dialog (or custom buttons) [Android] PermissionsAndroid request - missing dismiss button for initial dialog (or custom buttons) May 17, 2018
@react-native-bot
Copy link
Collaborator

It looks like your issue may refer to an older version of React Native. Can you reproduce the issue on the latest release, v0.55?

@react-native-bot react-native-bot added ⏪Old Version Platform: Android Android applications. Platform: Linux Building on Linux. labels May 17, 2018
@MarkOSullivan94 MarkOSullivan94 changed the title [Android] PermissionsAndroid request - missing dismiss button for initial dialog (or custom buttons) PermissionsAndroid request - missing dismiss button for initial dialog (or custom buttons) May 17, 2018
@MarkOSullivan94
Copy link
Author

I assume this is still the case in 0.55 as there's nothing been updated in the docs to suggest otherwise.

@react-native-bot
Copy link
Collaborator

Can you reliably confirm that this is still an issue in 0.55.4 (stable) or 0.56.0-rc (release candidate)?

@MarkOSullivan94
Copy link
Author

Yes.

@react-native-bot
Copy link
Collaborator

I am closing this issue because it does not appear to have been verified on the latest release, and there has been no followup in a while.

If you found this thread after encountering the same issue in the latest release, please feel free to create a new issue with up-to-date information by clicking here.

@react-native-bot react-native-bot added the Ran Commands One of our bots successfully processed a command. label Jul 17, 2018
@facebook facebook locked as resolved and limited conversation to collaborators Jul 18, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Android Android applications. Platform: Linux Building on Linux. Ran Commands One of our bots successfully processed a command. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

2 participants