expo: ImagePicker.launchCameraAsync does not open in the full screen on iOS devises

Summary

After upgrading to SDK 41, the Camera view does not open to the full screen with ImagePicker.launchCameraAsync on iOS devices any more . On iPad it opens in the center of the screen overlaying the screen it was opened from, which looks very weird. on iPhone, it also looks like an overlay on top of the parent screen, and you can see the portion of the parent header. Another indicator that it does not open to the full screen, it that there is a grey shaded area blow the 1x, 2x zoom indicator. If you drag the top portion (the one that has flash cam control) up, the grey area under the zoom indicator disappears (slides down). When you release the finger, everything snaps back to previous state as shown on the attachment photo. The gray area is blocking part of the photo view, which makes it harder to understand the boundaries of the photo being taken. It also gets in a way of the zoom control working properly – definitely something is not working the way it was intended. 57fa9f521f896ca8353581ed7458a5ce9414fb5e

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

41, 42

Environment

Expo CLI 4.7.2 environment info: System: OS: macOS 11.4 Shell: 3.2.57 - /bin/bash Binaries: Node: 15.5.0 - ~/.nvm/versions/node/v15.5.0/bin/node Yarn: 1.22.10 - /usr/local/bin/yarn npm: 7.19.1 - ~/.nvm/versions/node/v15.5.0/bin/npm Watchman: 2021.06.07.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: API Levels: 23, 26, 28, 29, 30 Build Tools: 28.0.3, 29.0.2, 30.0.2 System Images: android-29 | Intel x86 Atom, android-29 | Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom, android-29 | Google Play Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom Android NDK: 22.0.7026061 IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild npmPackages: expo: ~42.0.1 => 42.0.1 react: 16.13.1 => 16.13.1 react-dom: 16.13.1 => 16.13.1 react-native: https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz => 0.63.2 react-native-web: ~0.13.12 => 0.13.18 npmGlobalPackages: expo-cli: 4.7.2 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Barebones project was created to demonstrate the issue https://github.com/echowaves/CameraBug Just install it and run yarn; yarn start, then open on your iPhone or iPad with expo. Click a button (the only button on a screen) to launch a camera view and see that it does not open to the full screen.

Here is the line where the ImagePicker.launchCameraAsync is invoked.

https://github.com/echowaves/CameraBug/blob/cff7c0d4d583fa58a644ffcc31895005c7c0e82b/App.js#L19

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 12
  • Comments: 20 (2 by maintainers)

Commits related to this issue

Most upvoted comments

Can anyone advise when this bug is scheduled to be fixed? This is pretty annoying issue which ruins UX for a lot of apps that use Camera.

Is this something that we can hope to get a patch release for? This is a big deal for User Experience and there is no work around available. Or this is something that is scheduled for sdk 43 to be fixed in?

Unfortunately I do have the same issue. Any ideas on a workaround? With this behavior my app feels unusable. 😞 And I do not see any options to steer the behavior.

@charles-goode thank you so much that is very helpful. I can try creating a PR in the next days.

Hi all,

I also have this issue. Tested via the Snack link on this page: https://docs.expo.dev/versions/v41.0.0/sdk/imagepicker/

The issue is in since 41.0.0. On 40.0.0 it is working fine. Just checked with “launchImageLibraryAsync” but would expect the same for launchCameraAsync

Best regards, and please fix it soon 😃

Can confirm we’re having this same problem. Agree it seemed to appear around SDK 41 / 42, as we didn’t have the issue before

Also having this issue

Posting a forum discussion FYI, perhaps this will provide additional context: https://forums.expo.io/t/imagepicker-launchcameraasync-does-not-open-in-the-full-screen-on-ios-devises/53522/3

@charles-goode thank you so much that is very helpful. I can try creating a PR in the next days.

Hi @a-zen, Are you going to create a PR? If not, I can do this.

Really, upgrading to the latest version of SDK would be the way to go.

Hi @dmitryame, this patch will be part of the next SDK release. Also the beta one.

@mstach60161 sorry I created a draft of a solution here:

https://github.com/a-zen/expo/commit/922809733928e1a618dd48b50682b9fd14da7c0b

but I wasn’t able to get a hold of Mac. Please go ahead and create a PR.

Thank you.