react-native-orientation-locker
react-native-orientation-locker copied to clipboard
unlockAllOrientations does not work
I created a screen and upon loading I lock it to landscape mode. After that I cannot unlock it, it remains in landscape mode. I can change it to lock in portrait mode after being in landscape mode and that works, but Orientation.unlockAllOrientations() never works.
To test I even created a button to unlock orientation, simply calling Orientation.unlockAllOrientations() when pressed and it does not work. orientation remains locked.
I am using ReactNative 0.59.x
@olinations I ran into the same issue. I'm using Wix React Native Navigation for navigation and I realized that I needed to enable both orientations in the settings. That may not help you but it might help others who run into this issue.
Navigation.events().registerAppLaunchedListener(async () => {
Navigation.setDefaultOptions({
...
layout: {
orientation: ["portrait", "landscape"] // <-- Enable both orienations
},
...
})
Navigation.setRoot({
...
})
})