You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2022/10/28 11:10:55 UTC
[GitHub] [cordova-plugin-screen-orientation] erisu commented on a diff in pull request #102: fix(ios): #100 - Resolve orientation issues on iOS 16+
erisu commented on code in PR #102:
URL: https://github.com/apache/cordova-plugin-screen-orientation/pull/102#discussion_r1007945348
##########
src/ios/CDVOrientation.m:
##########
@@ -80,7 +80,13 @@ -(void)screenOrientation:(CDVInvokedUrlCommand *)command
}
if (value != nil) {
_isLocked = true;
- [[UIDevice currentDevice] setValue:value forKey:@"orientation"];
+ if (@available(iOS 16.0, *)) {
+ #if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_15_5 // Xcode 14 and iOS 16, or greater
+ [self.viewController setNeedsUpdateOfSupportedInterfaceOrientations];
+ #endif
Review Comment:
This is only to make the CI pass.
The API that the OP has introduced in this PR is not available on older Xcode versions. The test fails to compile the code as it is referencing an unknown API to the Xcode version.
The above code will check the iOS version that correlates with an Xcode version. If the version of Xcode does not support the iOS version, the block of code that contains the new API is removed before compile.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org