ios – React Native Expo app not locking in PORTRAIT mode for iPads


I have to drive my React Native Expo app to all the time run on PORTRAIT mode on all gadgets as a result of the way it’s constructed nevertheless it does not work for iPads.

I’ve tried setting the orientation within the app.json file to portrait and this works positive for nearly all gadgets besides iPads. That is essential as a result of apple could be very pedantic in regards to the app’s design. I additionally tried ‘expo-screen-orientation’ and it did not work too. Any solutions can be enormously useful, thanks a ton guys!

Under are some related snippets:

"expo": { "identify": "<app identify>", "slug": "<app identify>", "model": "1.0.0", "orientation": "portrait", "scheme": "<scheme>", "icon": "./belongings/icon.png", "userInterfaceStyle": "mild", "plugins": ["@react-native-google-signin/google-signin", "expo-screen-orientation" ], "assetBundlePatterns": [ "**/*" ],

App.js

useEffect(() => { (async () => { attempt { await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.PORTRAIT_UP); } catch (error) { console.error(error); } })(); }, []);

I’ve this operate (I do know i do not want the await, however I needed to attempt it nonetheless because it did not work with out anyway.

exposdk:48.0.0

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles