Getting Not Supported Error while using Ionic3

Viewed 2899

I strangle to be able to catch this error. While on desktop, this code raise this NotSupportedError:

enter image description here

I normally debug on chrome.

Here is the code:

import {Component} from "@angular/core";
import {ScreenOrientation} from "@ionic-native/screen-orientation";

@IonicPage()
@Component({
  selector: 'page-loading',
  templateUrl: 'page-loading.html',
})
export class PageLoading {

  constructor(private screenOrientation:ScreenOrientation) {}

  ionViewDidLoad() {
    console.log('ionViewDidLoad PageLoading');

    try{
        this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT).then(()=>{
          console.log('lock');
        });
    }catch(e){
      console.warn('No cordova.js')
    }

  }

}
1 Answers
Related