Skip to content
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

fix(android, ios): use clobbers to overwrite screen.orientation #116

Merged
merged 2 commits into from
Sep 7, 2023

Conversation

jcesarmobile
Copy link
Member

@jcesarmobile jcesarmobile commented Apr 20, 2023

For some reason the screen.orientation overwrite done from the current javascript code is not working properly in iOS 16.4 and newer.
Using the clobbers tag in plugin.xml seems to fix the issue and the plugin keeps working on previous iOS versions and on Android.

closes #114
closes #35

@luelher
Copy link

luelher commented Apr 27, 2023

I can confirm that this patch works in my ionic5 and Angular12 app for iOS 16.4, 16.1, 15.1 and Android 11, 12 y 13 tested in real devices.

@jeremywj
Copy link

This mostly works but I've noticed two issues:

  1. If locked to portrait and app is opened in landscape it will stay in landscape until device is rotated. Only then will it flip to portrait and lock.

  2. If locked to portrait and opened in portrait it will flip to landscape if device is rotated but immediately flip back after about 1 second. This only occurs once and then the lock seems to hold.

@jeremywj
Copy link

jeremywj commented May 1, 2023

This mostly works but I've noticed two issues:

1. If locked to portrait and app is opened in landscape it will stay in landscape until device is rotated.  Only then will it flip to portrait and lock.

2. If locked to portrait and opened in portrait it will flip to landscape if device is rotated but immediately flip back after about 1 second.  This only occurs once and then the lock seems to hold.

Updating capacitor to 4.8.0 resolved the issues above.

@capc0 capc0 mentioned this pull request May 2, 2023
3 tasks
Copy link
Member

@erisu erisu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM

@suyundukov suyundukov mentioned this pull request May 12, 2023
5 tasks
@bvleto
Copy link

bvleto commented May 18, 2023

Wondering when this will be merge completed?

@thijssondag
Copy link

Also wondering when this merge will be completed. We would love to use this!

@laberg
Copy link

laberg commented May 30, 2023

Same here, really need this fix !

@yanbodang

This comment was marked as abuse.

@ryaa
Copy link

ryaa commented Aug 1, 2023

any plans to release this fix?

@rifaniponk
Copy link

please release this fix

@filipRisteski
Copy link

Any chance we can push this forward?

@jroeglin
Copy link

jroeglin commented Aug 3, 2023

What is the reason for not releasing this fix?

@Scooby27
Copy link

Looks like tests for iOS 13 and 14 are failing. Are there any updates on getting this fix published?

@jroeglin
Copy link

I had a very short look in the details but didn't get the failure.

@filipRisteski
Copy link

Logs have expired now. So what's happening?

@Choppel

This comment was marked as abuse.

@erisu erisu changed the title fix(ios): use clobbers to overwrite screen.orientation fix(android, ios): use clobbers to overwrite screen.orientation Sep 7, 2023
@erisu erisu merged commit 6014006 into master Sep 7, 2023
@erisu erisu deleted the use-clobbers branch September 7, 2023 11:44
@Scooby27
Copy link

Are there any releases planned with this fix?

@JothikannanC
Copy link

I am also having the same issue, any ETA on this?

@JothikannanC
Copy link

who are all having this issue, please follow

cordova plugin remove cordova-plugin-screen-orientation
cordova plugin add https://github.com/apache/cordova-plugin-screen-orientation.git

this will update the plugin into latest code, and now orientation is working fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Orientation is an empty object on iOS16 screen.orientation.lock() is not available on this device.