@capawesome/capacitor-screen-orientation 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- <p align="center"><br><img src="https://user-images.githubusercontent.com/236501/85893648-1c92e880-b7a8-11ea-926d-95355b8175c7.png" width="128" height="128" /></p>
1
+ <p align="center"><br><img src="https://avatars.githubusercontent.com/u/105555861" width="128" height="128" /></p>
2
2
  <h3 align="center">Screen Orientation</h3>
3
3
  <p align="center"><strong><code>@capawesome/capacitor-screen-orientation</code></strong></p>
4
4
  <p align="center">
@@ -134,7 +134,16 @@ import UIKit
134
134
  case UIInterfaceOrientation.portraitUpsideDown.rawValue:
135
135
  return "portrait-secondary"
136
136
  default:
137
- let isPortrait = UIApplication.shared.statusBarOrientation.isPortrait
137
+ var isPortrait = false
138
+ if #available(iOS 13.0, *) {
139
+ isPortrait = UIApplication.shared.windows
140
+ .first?
141
+ .windowScene?
142
+ .interfaceOrientation
143
+ .isPortrait ?? false
144
+ } else {
145
+ isPortrait = UIApplication.shared.statusBarOrientation.isPortrait
146
+ }
138
147
  return isPortrait ? "portrait-primary" : "landscape-primary"
139
148
  }
140
149
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-screen-orientation",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Capacitor plugin to lock/unlock the screen orientation.",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",