Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


branch: master

Removed whitespace

latest commit eae473352a
Adam Maloney authored May 15, 2013
Octocat-spinner-32 Orientation.h added files April 24, 2012
Octocat-spinner-32 Orientation.m added files April 24, 2012
Octocat-spinner-32 OrientationPlugin.js Removed whitespace May 15, 2013
Octocat-spinner-32 Update April 24, 2012


Plugin for enabling/disabling device orientation

In Xcode project

Place Orientation.h & Orientation.m in to plugins folder

Add into Appdelegate.h


    @interface AppDelegate : PhoneGapDelegate {

        NSString* invokeString;

    - @property (copy)  NSString* invokeString;

    - (void)setOrientation:(NSArray *)arguments;


Add into AppDelegate.m

    - (void) dealloc
        [super dealloc];

    - (void)setOrientation:(NSArray *)arguments
        self.viewController.supportedOrientations = arguments;

Add field into Supporting Files / .plist

name: orientation (value: Orientation)


Include OrienationPlugin.js in index.html

Params in object:

  • pp - Portrait
  • pd - Portrait upside down
  • ll - Landscape left
  • lr - Landscape right

Examples (in javascript)

Portrait only

window.plugins.orientation.setAllowed([{pp:true, pd:false, ll:false, lr:false}]);

All, except Portrait upside down

window.plugins.orientation.setAllowed([{pp:true, pd:false, ll:true, lr:true}]);
Something went wrong with that request. Please try again.