ImagePicker.launchCameraAsync Only working on Expo Client & Android no iOS Device

#1

I have permissions granted, and it works on the Expo client and on Android, but on iOS when published to an app the camera never launches.

PickImage = async () => {
		this.setState({loadingCamera: true });
		console.log("try picking");
		let { status } = await Permissions.askAsync(Permissions.CAMERA);
		if (status !== 'granted') {
			this.setState({
				errorMessage: 'Permission to access camera was denied',
			});
		}

		let pickerResult = await ImagePicker.launchCameraAsync({
		  allowsEditing: false,
		});

		console.log(pickerResult);

		if (!pickerResult.cancelled) {
			this.setState({ image: pickerResult.uri, loadingCamera: false, });
		} else {			
			this.setState({ uploading: false, loadingCamera: false, });
		}
		
    	this.ManagePickedImage(pickerResult);
	};

Does anyone have any idea why this might be? I’m all out of things to try.

0 Likes

#2

Hi! Do you think you could create an MCVE and upload it to Snack so we can reproduce this issue locally? It’ll be a lot easier to help if we can see all of the code necessary to recreate this issue. Thanks!

0 Likes

#3

I was able to resolve it by adding Permissions.CAMERA_ROLL . I’m not sure why both are needed, but it resolved it so that’s good enough for me at the moment.

Thanks for the reply!

0 Likes

closed #4

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.

0 Likes