apache / cordova-plugin-screen-orientation

Apache Cordova Screen Orientation Plugin
https://cordova.apache.org/
Apache License 2.0
219 stars 228 forks source link

Error CDVOrientation screenOrientation INVALID ["options": [15, any]] on unlock() method in iOS #85

Open rdece opened 3 years ago

rdece commented 3 years ago

Bug Report

I am trying to unlock the restricted portrait mode of an Ionic App in just one of the pages.

Problem

The plugin seems to work perfectly fine on Android yet whenever i try it on iOS i get thrown an error.

What is expected to happen?

Whenever i enter this page i am calling the unlock() method of the plugin to allow the screen change of orientation

What does actually happen?

It returns an error such as "To Native Cordova -> CDVOrientation screenOrientation INVALID ["options": [15, any]]" in Xcode and "TypeError: ctx.unlockScreenOrientation is not a function. (In 'ctx.unlockScreenOrientation()', 'ctx.unlockScreenOrientation' is undefined)" in the browser console.

The method lock() also seems to throw the same error at Xcode varying just the number of the options for 12 or 3 depending on the orientation i try to lock to.

Environment, Platform, Device

I have tested on a physical iPhone 8 device and simulators up to iPhone 12 from the 14.2 software version above

Version information

"@capacitor/android": "^2.4.5", "@capacitor/core": "^2.4.6", "@capacitor/ios": "^2.4.5", "@ionic-native/core": "^5.0.0", "@ionic-native/screen-orientation": "^5.34.0", "@ionic/angular": "^5.0.0", "cordova-plugin-screen-orientation": "^3.0.2",

Checklist