I develop an app for all platforms using phoneGap. I need to lock the orientation on a specific page to landscape. on all other pages the user can rotate the device.
I installed the plugin net.yoik.cordova.plugins.screenorientation as written:
cordova plugin add net.yoik.cordova.plugins.screenorientation
It is supposed to add the following lockOrientation, unlockOrientation & orientation to the screen object.
The problem is that when I try to call it (on DeviceReady) like this:
screen.lockOrientation('landscape');
or
alert('screen.orientation=' + screen.orientation)
but on both cases the program stop. I don't know what is the error msg cause on phoneGap console it shows nothing
I checked to see if the plugin is installed using: cordova plugin -list and it is installed.
two questions:
- Anyone knows the correct way to use this plugin? or any other alternative for locking orientation on all devices?
- since it runs on the device, how do I see the error message? the phonegap console shows nothing.