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: orientation on iOS16 #413

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix: orientation on iOS16 #413

wants to merge 1 commit into from

Conversation

gramiro
Copy link

@gramiro gramiro commented Sep 30, 2022

I've modified Orientation.m according to what Apple is requiring on iOS16 since [[UIDevice currentDevice] setValue:forKey:]; appears to be buggy.

Notice that the changes are under a condition of the OS being iOS16.

}];

[Orientation setOrientation:UIInterfaceOrientationMaskLandscapeRight];
[self lockToOrientationWithMask:UIInterfaceOrientationMaskLandscapeRight interfaceOrientation:UIInterfaceOrientationLandscapeRight deviceOrientation:UIDeviceOrientationLandscapeRight];
}

RCT_EXPORT_METHOD(unlockAllOrientations)
Copy link

Choose a reason for hiding this comment

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

We also need to update unlockAllOrientations to -

RCT_EXPORT_METHOD(unlockAllOrientations)
{
  #if DEBUG
    NSLog(@"Unlock All Orientations");
  #endif
  UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation];
  [Orientation setOrientation:UIInterfaceOrientationMaskAllButUpsideDown];
  [self lockToOrientationWithMask:UIInterfaceOrientationMaskAllButUpsideDown interfaceOrientation:UIInterfaceOrientationMaskAllButUpsideDown deviceOrientation:orientation];
}

Copy link

Choose a reason for hiding this comment

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

@gramiro - Any update?

Choose a reason for hiding this comment

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

hey, guys please update ASAP. we are stuck here for the build.

Copy link
Author

Choose a reason for hiding this comment

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

hi guys, sorry, been a while. @QSuraj I didn't include this since it was not in the original library

@NeerajNema1988
Copy link

Other than iOS 16, Builds are failing.

@codal-mpawar
Copy link

Other than iOS 16, Builds are failing.

same issue for me iOS builds are failling.

@nicolas6422
Copy link

Fixed failing build by wrapping ios 16 code with #ifdef __IPHONE_16_0

Here's a patch file I made if you're using patch-package

https://gist.github.com/nicolas6422/80cbc4528b4d4798c53ffdd2f56c3625

@kesha-antonov
Copy link

Fixed failing build by wrapping ios 16 code with #ifdef __IPHONE_16_0

Here's a patch file I made if you're using patch-package

https://gist.github.com/nicolas6422/80cbc4528b4d4798c53ffdd2f56c3625

works on ios 16

@gramiro
Copy link
Author

gramiro commented Nov 23, 2022

@nicolas6422 do you know if that's future proof? Like next year's iOS 17?

@nicolas6422
Copy link

@gramiro yes, __IPHONE_16_0 will always be defined after for Xcode >= 14

@codal-mpawar
Copy link

@gramiro @nicolas6422 any update for release mode because its not working for release mode.

@brycnguyen
Copy link

Seeing the same issue that this doesn't work in release mode

@ubdorji
Copy link

ubdorji commented Dec 1, 2022

@codal-mpawar ran into a similar issue, for us we build our app with eas so it was about setting the image property of ios to latest in our eas.json file so that our app was built with the latest Xcode 14.1 sdk.

@codal-mpawar
Copy link

@gramiro If you have a solution can you please fork the library and try to resolve this if possible? it will great help for us.

@LuczDev
Copy link

LuczDev commented Feb 23, 2023

seems the camera screen is also orientated, is any way to fix?

@swaroopaillinda
Copy link

hii as any one found solution I am also facing issue related to orientation locktolandscape not working

Please @LuczDev if you found any solution please respond asap thanks

@Yandamuri
Copy link

@gramiro If you have a solution can you please fork the library and try to resolve this if possible? it will great help for us.

Did you find solution for release mode?

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.