I have a code, that asks a permissions for an Android storage. When i run it on emulator(pixel 8 pro) it works correctly, but when i build project as release version and install it on my own Galaxy A73, permissions permissions are not asked and are rejected by default. I can’t figure out what the problem is.
The code:
import {request, PERMISSIONS} from 'react-native-permissions';
import {Button} from 'react-native';
const App = () => {
const ask = () => {
request(PERMISSIONS.ANDROID.READ_EXTERNAL_STORAGE).then(res => {
console.log(res);
});
}
return (
<Button title = "ask" style = {{
width: '100%',
height: '100%',
}} onPress = {() => ask()}>
</Button>
);
};
export default App;
I tried several libs, like AndroidPermissions, but it works same.
New contributor
Алексей Алматинов is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.