ScreenRotation.ALL error in iOS

#1

Hi, i’ve found an issue after updating to Expo 31 i’m getting an error on iOS 12.1, specifically on iPhone X, when i call this on a screen:

ScreenOrientation.allowAsync(ScreenOrientation.Orientation.ALL);

I get the following error: This device does not support this orientation ALL. Here is the info: https://sentry.io/share/issue/3611f7bb3d844319922fc004a901daf9/

Also, i’ve noticed in Android, when i lock in the settings the view to vertical the phone keeps changing the orientation.

Thanks!

#2

hi @ispcloudservices

Regarding your iOS question: the ALL orientation contains the PORTRAIT_UPSIDE_DOWN mode, which is not natively supported on the iPhone X. Here is a list of devices that don’t support the portrait upside down mode: https://github.com/expo/expo/blob/af2d7e3c848cf49a47378970f23e080e1ada6755/ios/Exponent/Versioned/Core/Api/EXScreenOrientation.m#L89

Regarding your Android question: Depending on what orientation you’ve locked your phone to, Android uses a variety of phone sensors/user settings to determine whether it should rotate the screen. Here is a mapping of our API to the native android settings, and here are the descriptions of the Android lock policies:


https://developer.android.com/reference/android/R.attr#screenOrientation

1 Like
#3

Thanks! This solved my problem, maybe it can be added to Documentation pages in the future.

closed #4

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