Expo Screen Orientation not working

Hey all, I'm having an issue where I can't get the expo-screen-orientation package to work, I've tried on a latest v iOS simulator and on the expo app via my phone, both of which won't let me lock to landscape, here is my code, would be much appreciated if you could help. I am calling this function inside a specific screen, I'm assuming this must be allowed right?
const onLoadLockToPortrait = async () => {
try {
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.LANDSCAPE_LEFT
);
} catch (error) {
console.log(error);
}
};

React.useEffect(() => {
onLoadLockToPortrait();
}, []);
const onLoadLockToPortrait = async () => {
try {
await ScreenOrientation.lockAsync(
ScreenOrientation.OrientationLock.LANDSCAPE_LEFT
);
} catch (error) {
console.log(error);
}
};

React.useEffect(() => {
onLoadLockToPortrait();
}, []);
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server