-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: CDVOrientation screenOrientation INVALID when trying to set orientation #4357
Comments
This issue may need more information before it can be addressed. In particular, it will need a reliable Code Reproduction that demonstrates the issue. Please see the Contributing Guide for how to create a Code Reproduction. Thanks! |
Updated with the code reproduction demo project |
@kevinainleywalker Here it says not to use the Cordova plugin. So how did you do it on Android then? #2977 (comment) |
@Sampath-Lokuge it says not to use it unless you have to change orientation programmatically, which I do. It's still the recommended method on the ionic capacitor docs and works perfectly on capacitor v2.4.7. I have other issues with android so I have not made it far enough to confirm that it works on that platform unfortunately. |
Hi @jcesarmobile |
@Sampath-Lokuge, please don't ping me If you ask on any of them, I'll gladly answer you there when I see it (I check both of them from time to time, so might take a while until I see it) |
Ok sure. Done: #4377 |
I am using Ionic/Capacitor and Vuejs, I also had the same problem with the plugin for iOS. This is what I did and it solved the problem. To fix the bug to be able to lock the screen to the specified orientation on iOS: 1. Open AppDelegate.swift for your app. You can find this file inside ios/App/App/AppDelegate.swift var orientationLock = UIInterfaceOrientationMask.all func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask { @objc func setOrientationLock(_ notification: Notification) 3. In the same file locate: "func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {" |
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out. |
Bug Report
Capacitor Version
Platform(s)
IOS
Current Behavior
When setting the orientation (using the [email protected] plugin), the orientation does not change and the following error is reported in the xcode log:
Expected Behavior
The orientation of the app should change to the requested orientation
Code Reproduction
Demo Project
In the app component of this demo ionic capacitor project (updated to capacitor 3 RC) the component calls
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.LANDSCAPE);
which generates the same error and doesn't change orientation:Other Technical Details
npm --version
output: 6.14.11node --version
output: v14.15.5pod --version
output (iOS issues only): 1.10.1Additional Context
using ionic with the following plugins:
The text was updated successfully, but these errors were encountered: