async onPickFileButtonPressed(context) { let result; let permission = await Permissions.getAsync(Permissions.CAMERA_ROLL); if (!permission.granted) { permission = await ImagePicker.requestCameraRollPermissionsAsync({base64: false, exif: false}); if (permission.granted) { result = await ImagePicker.launchImageLibraryAsync(); if (!result.cancelled) context.updateStateProperty("file", result.uri); } } else { result = await ImagePicker.launchImageLibraryAsync(); if (!result.cancelled) context.updateStateProperty("file", result.uri); } }
async onPickFileButtonPressed(context) { let result; let permission = await Permissions.getAsync(Permissions.CAMERA_ROLL); if (!permission.granted) { permission = await ImagePicker.requestCameraRollPermissionsAsync({base64: false, exif: false}); if (permission.granted) { result = await ImagePicker.launchImageLibraryAsync(); if (!result.cancelled) { let newPassportForm = context.state.passportForm; newPassportForm.file = result.uri.toString(); context.updateStateProperty("passportForm", newPassportForm); } } } else { result = await ImagePicker.launchImageLibraryAsync(); if (!result.cancelled) { let newPassportForm = context.state.passportForm; newPassportForm.file = result.uri.toString(); context.updateStateProperty("passportForm", newPassportForm); } } }