JeffBerman opened a new pull request, #142: URL: https://github.com/apache/cordova-plugin-screen-orientation/pull/142
### Platforms affected cordova-ios version 8.0+ ### Motivation and Context Cordova iOS 8 removed CDVViewController's supportedOrientations API, but this plugin still calls setSupportedOrientations: on iOS. This PR restores the functionality needed by the plugin and implements supportedInterfaceOrientations so UIKit receives the current dynamic orientation mask. Closes #140. ### Description This change restores the Cordova iOS API that the cordova-plugin-screen-orientation plugin expects, then connects that restored state to UIKit’s normal orientation mechanism. - The old plugin calls setSupportedOrientations: on CDVViewController. - Cordova iOS 8 removed that method. - The new .m file in this PR adds that method back at runtime. - It stores the requested orientations on the Cordova view controller. - It also adds supportedInterfaceOrientations, which is the UIKit method iOS actually asks when deciding what orientations are allowed. ### Testing After building against `cordova-ios` 8.1.0 and running on an iPhone 15, my test code calls: - `screen.orientation.lock()` - `screen.orientation.unlock()` - and references `screen.orientation` ### Checklist - [ ] I've run the tests to see all new and existing tests pass - [ ] I added automated test coverage as appropriate for this change - [x] Commit is prefixed with `(platform)` if this change only applies to one platform (e.g. `(android)`) - [x] If this Pull Request resolves an issue, I linked to the issue in the text above (and used the correct [keyword to close issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/)) - [x] I've updated the documentation if necessary ### Comments I'm not sure what sort of automated tests Cordova has, but orientation locked, unlocked, and returned the current orientation state on my phone in my tests. No documentation changes are required, as this PR merely restores functionality that was broken by the cordova-ios platform update. Please let me know if I need to do anything else for this PR -- thanks! -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
