-
Notifications
You must be signed in to change notification settings - Fork 24k
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
Android 13 (SDK 33) Permission Issue #36714
Comments
|
@venukaaventude asking for these permissions on Android 13 is no longer needed. More info: This is how I'm using permissions now: export const checkAndroidPermission = async () => {
if (Platform.OS === "android" && Platform.Version < 33) {
const granted = await PermissionsAndroid.requestMultiple([
"android.permission.CAMERA",
"android.permission.WRITE_EXTERNAL_STORAGE"
]);
if (
granted["android.permission.CAMERA"] !== "granted" ||
granted["android.permission.WRITE_EXTERNAL_STORAGE"] !== "granted"
) {
throw new Error("Required permission not granted");
}
}
}; export const checkAndroidPermissionCameraRoll = async () => {
if (Platform.OS === "android" && Platform.Version < 33) {
const granted = await PermissionsAndroid.requestMultiple([
"android.permission.WRITE_EXTERNAL_STORAGE",
"android.permission.READ_EXTERNAL_STORAGE"
]);
if (
granted["android.permission.WRITE_EXTERNAL_STORAGE"] !== "granted" ||
granted["android.permission.READ_EXTERNAL_STORAGE"] !== "granted"
) {
throw new Error("Required permission not granted");
}
}
}; |
@efstathiosntonas
|
Hi I am using @ionic-native/media-capture pluigin for my react ionic project with capacitor 5. The media capture for video, audio and camera is working fine in Android 12 and below devices and also iOS devices .But for android 13 devices the camera capture is not working.Tried out new permission for media in android manifest as suggested in android documentation still not working.We came to know that the ionic.native was replaced with @awesome-cordova-plugins. We tried this also, but didn't worked. Permission code added in android.manifest file is given below:- if any solutions.Please suggest |
may be it will help you No, WRITE_EXTERNAL_STORAGE permission does not work on Android 11 or higher. You need to use the MANAGE_EXTERNAL_STORAGE permission instead¹². You also need to set the maxSdkVersion to 29 or lower in your manifest file³. Alternatively, you can use the MediaStore API to access media files without any permissions⁴. Source: Conversation with Bing, 14/8/2023 |
Description
Hi,
I am unable to request permission for storage. It always returns {"android.permission.READ_EXTERNAL_STORAGE": "never_ask_again", "android.permission.WRITE_EXTERNAL_STORAGE": "never_ask_again"} whenever I try to ask for permission. I tried everything but still the the permission is not allowed on Android 13, sdk 33.
Your help will be really appreciated.
Thank you.
React Native Version
0.60.6
Output of
npx react-native info
System:
OS: macOS 12.6
CPU: (8) arm64 Apple M1 Pro
Memory: 85.36 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 19.1.0 - /var/folders/xb/vpg5x6bn70j8zj9kq_xl9jv80000gn/T/yarn--1680154755528-0.49562717776096243/node
Yarn: 1.22.19 - /var/folders/xb/vpg5x6bn70j8zj9kq_xl9jv80000gn/T/yarn--1680154755528-0.49562717776096243/yarn
npm: 9.1.2 - /opt/homebrew/bin/npm
Watchman: 2022.11.14.00 - /opt/homebrew/bin/watchman
SDKs:
iOS SDK:
Platforms: DriverKit 22.1, iOS 16.1, macOS 13.0, tvOS 16.1, watchOS 9.1
Android SDK:
API Levels: 21, 23, 27, 28, 29, 30, 31, 32, 33
Build Tools: 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3, 31.0.0, 33.0.0
System Images: android-31 | Google APIs ARM 64 v8a, android-33 | Google APIs ARM 64 v8a
IDEs:
Android Studio: 2021.3 AI-213.7172.25.2113.9123335
Xcode: 14.1/14B47b - /usr/bin/xcodebuild
npmPackages:
react: 16.8.6 => 16.8.6
react-native: 0.60.6 => 0.60.6
npmGlobalPackages:
react-native: 0.70.4
Steps to reproduce
declare permission issue in manifest file
request for storage permission
const granted = await PermissionsAndroid.request(
PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE,
);
if (granted === PermissionsAndroid.RESULTS.GRANTED) {
console.log('Storage Permission Granted.');
} else {
Alert.alert('Error', 'Storage Permission Not Granted');
}
result
{"android.permission.READ_EXTERNAL_STORAGE": "never_ask_again", "android.permission.WRITE_EXTERNAL_STORAGE": "never_ask_again"}
Snack, code example, screenshot, or link to a repository
The text was updated successfully, but these errors were encountered: