title: ScreenOrientation lock API wrong angle in iOS
body: <p>Issue: Screen is turning towards anticlockwise (landscape-secondary) while calling <em>this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE)</em></p>
  <p>I can't use   <em>this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE_PRIMARY);</em> hardcoded as I want to support both LANDSCAPE_PRIMARY and LANDSCAPE_Secondary.</p>
  <p>Goal: To lock the screen in landscape mode, but the app should turn towards clockwise direction (landscape-primary) while lockinng the screen in landscape mode.</p>
  <p>I want the screen to go towards clockwise direction when I call this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);</p>
  <p>Details of my sample project:</p>
  <p>I have created an Ionic app from starter template:</p>
  <pre><code>ionic start myApp tabs --capacitor
  </code></pre>
  <p>Added the <a href="https://ionicframework.com/docs/native/screen-orientation" rel="nofollow noreferrer">Screen Orientation</a> plugin by running these commands:</p>
  <pre><code>npm install cordova-plugin-screen-orientation 
  npm install @awesome-cordova-plugins/screen-orientation 
  ionic cap sync
  </code></pre>
  <p>Added iOS target via these commands:</p>
  <pre><code>ionic build --prod
  npm install @capacitor/ios
  npx cap add ios
  npx cap copy ios 
  npx cap sync ios
  </code></pre>
  <p>app.module.ts:</p>
  <pre><code>import { NgModule } from '@angular/core';
  import { BrowserModule } from '@angular/platform-browser';
  import { RouteReuseStrategy } from '@angular/router';
  
  import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
  
  import { AppRoutingModule } from './app-routing.module';
  import { AppComponent } from './app.component';
  import { ScreenOrientation } from '@awesome-cordova-plugins/screen-orientation/ngx';
  
  @NgModule({
    declarations: [AppComponent],
    imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
    providers: [
      { provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
      ScreenOrientation,
    ],
    bootstrap: [AppComponent],
  })
  export class AppModule {}
  </code></pre>
  <p>App component.ts code:</p>
  <pre><code>import { Component } from '@angular/core';
  import { ScreenOrientation } from '@awesome-cordova-plugins/screen-orientation/ngx';
  
  @Component({
    selector: 'app-root',
    templateUrl: 'app.component.html',
    styleUrls: ['app.component.scss'],
  })
  export class AppComponent {
    constructor(private screenOrientation: ScreenOrientation) {
      // get current
      console.log(this.screenOrientation.type); // logs the current orientation, example: 'landscape'
  
      // set to landscape
      this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
  
      // detect orientation changes
      this.screenOrientation.onChange().subscribe(() =&gt; {
        console.log('Orientation Changed');
      });
    }
  }
  </code></pre>
  <p>After making the above change I have build the solution for iOS with these commands:</p>
  <pre><code>ionic build --prod
  npx cap copy ios 
  npx cap sync ios
  npx cap run ios
  </code></pre>
  <p>Running the above code in iPhone simulator I am getting the screen like this:</p>
  <p><a href="https://i.stack.imgur.com/dss3O.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dss3O.png" alt="enter image description here" /></a></p>
  <p>My goal is to turn the screen initially to right side i.e in clockwise direction while locking the screen into landscape mode while keeping both landscape primary and secondary supported. I want the screen to turn like this instead of what is coming as default in my previous screenshot:</p>
  <p><a href="https://i.stack.imgur.com/FmN3n.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FmN3n.png" alt="enter image description here" /></a></p>
  <p>Do note, that the same code has no issues while running the code against Android target in Ioinc project, i.e the following code    this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE); turns the screen to right side i.e in clock wise direction.</p>
  <p>Is this a bug in Cordova/iOS mapper for screen orientation?</p>