Freezing portrait mode

I am using these plugins :

$ cordova plugin add GitHub - Adlotto/cordova-plugin-recheck-screen-orientation
$ cordova plugin add net.yoik.cordova.plugins.screenorientation

Then in your app (usualy in config), just check which page that should be portrait or landscape (it’s more flexible rather than global preferences)

//check orientation
console.log('Orientation is ' + screen.orientation);
if(toState.orientation == 'portrait') {
  screen.lockOrientation('portrait');
}else{
  screen.lockOrientation('landscape');
}

Perhaps it will help

4 Likes