-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[expo-screen-orientation] Fix getting initial orientation. #8727
[expo-screen-orientation] Fix getting initial orientation. #8727
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct me if I'm wrong — this sounds like a good fix to the "initial orientation" problem, but I'm a little bit afraid that setting the mask to more rigid only after the app is foregrounded… could it mean that when a user taps on an icon they can see the rotation being executed (if the device would have been rotated while the app was in background).
Leaving this behavior of disabling lock when the app backgrounds may be useful for brownfield apps (eg. RN app lock shouldn't automatically impact app after being hidden — or maybe it should?), but if this feature would cause the app to rotate in background or something maybe we should rethink this. Does it rotate in background?
packages/expo-screen-orientation/ios/EXScreenOrientation/EXScreenOrientationRegistry.m
Outdated
Show resolved
Hide resolved
packages/expo-screen-orientation/ios/EXScreenOrientation/EXScreenOrientationRegistry.m
Outdated
Show resolved
Hide resolved
packages/expo-screen-orientation/ios/EXScreenOrientation/EXScreenOrientationRegistry.m
Show resolved
Hide resolved
Without this fix, the user could see the rotation in the background. Now, it'll freeze in the last set orientation. So, when you click on the home button, your app will be displayed in the correct orientation.
No, it doesn't rotate in the background. It will work like other native apps. |
Don't forget to add a note about this change in behavior (breaking, imho) that now the module will keep the lock active when the app backgrounds! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- changelog! 👏 👏 👏
93ce253
to
205f00b
Compare
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
205f00b
to
599ffdb
Compare
Why
Fixes #8210.
How
EXScreenOrientationRegisty
.Test Plan
Changelog
ScreenOrientation. getOrientationAsync
returning a wrong value when the application is starting.