@capawesome/capacitor-screen-orientation 7.0.0 → 7.0.2

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/Package.swift CHANGED
@@ -19,10 +19,10 @@ let package = Package(
19
19
  .product(name: "Capacitor", package: "capacitor-swift-pm"),
20
20
  .product(name: "Cordova", package: "capacitor-swift-pm")
21
21
  ],
22
- path: "ios/Sources/ScreenOrientationPlugin"),
22
+ path: "ios/Plugin"),
23
23
  .testTarget(
24
24
  name: "ScreenOrientationPluginTests",
25
25
  dependencies: ["ScreenOrientationPlugin"],
26
- path: "ios/Tests/ScreenOrientationPluginTests")
26
+ path: "ios/PluginTests")
27
27
  ]
28
28
  )
package/README.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Capacitor plugin to lock/unlock the screen orientation.
4
4
 
5
+ <div class="capawesome-z29o10a">
6
+ <a href="https://cloud.capawesome.io/" target="_blank">
7
+ <img alt="Deliver Live Updates to your Capacitor app with Capawesome Cloud" src="https://cloud.capawesome.io/assets/banners/cloud-deploy-real-time-app-updates.png?t=1" />
8
+ </a>
9
+ </div>
10
+
5
11
  ## Installation
6
12
 
7
13
  ```bash
@@ -11,6 +17,8 @@ npx cap sync
11
17
 
12
18
  ### iOS
13
19
 
20
+ #### General
21
+
14
22
  On iOS you must add the following to your app's `AppDelegate.swift`:
15
23
 
16
24
  ```diff
@@ -24,6 +32,15 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
24
32
  + }
25
33
  ```
26
34
 
35
+ #### iPad Orientation Lock
36
+
37
+ On iPad, you must add the following to your app's `Info.plist`:
38
+
39
+ ```xml
40
+ <key>UIRequiresFullScreen</key>
41
+ <true/>
42
+ ```
43
+
27
44
  ## Configuration
28
45
 
29
46
  No configuration required for this plugin.
@@ -30,9 +30,7 @@ import Capacitor
30
30
  strongSelf.requestGeometryUpdate(orientationValue: nextOrientationValue, orientationMask: nextOrientationMask)
31
31
  ScreenOrientation.supportedInterfaceOrientations = nextOrientationMask
32
32
  UINavigationController.attemptRotationToDeviceOrientation()
33
- if #unavailable(iOS 16) {
34
- strongSelf.requestGeometryUpdate(orientationValue: currentOrientationValue, orientationMask: currentOrientationMask)
35
- }
33
+ strongSelf.requestGeometryUpdate(orientationValue: currentOrientationValue, orientationMask: currentOrientationMask)
36
34
  strongSelf.notifyOrientationChangeListeners(orientationType)
37
35
  completion()
38
36
  }
@@ -40,11 +38,14 @@ import Capacitor
40
38
 
41
39
  @objc public func unlock(completion: @escaping () -> Void) {
42
40
  DispatchQueue.main.async {
43
- ScreenOrientation.supportedInterfaceOrientations = UIInterfaceOrientationMask.all
41
+ let orientationMask = UIInterfaceOrientationMask.all
42
+ ScreenOrientation.supportedInterfaceOrientations = orientationMask
44
43
  UINavigationController.attemptRotationToDeviceOrientation()
45
44
  guard let orientationType = self.lastOrientationType else {
46
45
  return
47
46
  }
47
+ let orientationValue = self.convertOrientationTypeToValue(orientationType)
48
+ self.requestGeometryUpdate(orientationValue: orientationValue, orientationMask: orientationMask)
48
49
  self.notifyOrientationChangeListeners(orientationType)
49
50
  completion()
50
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capawesome/capacitor-screen-orientation",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
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",