The app works fine in both iOS and Android in emulators and local device from the expo client. If I build it and release, it works fine in iOS but it does not work in android.
It does ask for camera permission (android does not ask for camera_roll permissions right?), but then it resolves the askAsync as DENIED no idea why.
Edit2: I’ve tried this to try to filter out where the issue is:
const checkPermission = async () => {
if (Platform.OS === 'ios') {
const { status } = await Permissions.getAsync(
Permissions.CAMERA,
Permissions.CAMERA_ROLL
);
if (status === 'granted') return true;
if (status !== 'granted') {
const grantedPermissions = await Permissions.askAsync(
Permissions.CAMERA,
Permissions.CAMERA_ROLL
);
if (grantedPermissions.status === 'granted') return true;
}
}
if (Platform.OS === 'android') {
const { status } = await Permissions.getAsync(Permissions.CAMERA);
if (status === 'granted') return true;
if (status !== 'granted') {
const grantedPermissions = await Permissions.askAsync(Permissions.CAMERA);
if (grantedPermissions.status === 'granted') return true;
}
}
return false;
};
This way, in android, the app now asks for permission, it now won’t save it as denied (so one issue is that the askAsync is resolving to denied), but, it now saves the permissions as status = undetermined, with camera status granted but cameraRoll as undetermined. The weird part is that now I can access the galery, but the camera doesnt show up, not even a button asking what camera app to use, it simple asks if you want to use camera or gallery and does nothing if you chose camera!
Ok, this issue is really weird and I feel the expo team should take a look as there might be edge cases in android that are not working. I got it to work in the standalone version by adding these permissions to app.json: