0

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:

  1. Anyone knows the correct way to use this plugin? or any other alternative for locking orientation on all devices?
  2. since it runs on the device, how do I see the error message? the phonegap console shows nothing.
Ori
  • 367
  • 3
  • 16
  • This plugin works fine - I use it in some of my own apps. Firstly, what platform are you testing on - Android or iOS? Then, what OS version and device? To debug this on Android you need you can view the [logcat](http://developer.android.com/tools/help/logcat.html) output or on iOS use XCode to run the app and you can see the debug output in the XCode console pane. – DaveAlden May 03 '15 at 19:25
  • thanks for your answer. I need to test on all platforms but currently on IOS. I dont use xcode. but run it with PhoneGap dev (on the device) against phoneGap desktop app on my development machine. for the installation, all I have to do is: cordova plugin add net.yoik.cordova.plugins.screenorientation ? – Ori May 03 '15 at 20:48

0 Answers0