@capgo/capacitor-screen-orientation 8.1.4 → 8.1.6

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.
@@ -17,7 +17,7 @@ import com.getcapacitor.annotation.CapacitorPlugin;
17
17
  @CapacitorPlugin(name = "CapacitorScreenOrientation")
18
18
  public class CapacitorScreenOrientationPlugin extends Plugin implements SensorEventListener {
19
19
 
20
- private final String pluginVersion = "8.1.4";
20
+ private final String pluginVersion = "8.1.6";
21
21
  private int currentOrientation;
22
22
  private SensorManager sensorManager;
23
23
  private Sensor accelerometer;
@@ -47,6 +47,12 @@ public class CapacitorScreenOrientationPlugin extends Plugin implements SensorEv
47
47
  protected void handleOnConfigurationChanged(Configuration newConfig) {
48
48
  super.handleOnConfigurationChanged(newConfig);
49
49
 
50
+ // Skip system orientation changes when motion tracking is active
51
+ // to avoid duplicate events
52
+ if (isTrackingMotion) {
53
+ return;
54
+ }
55
+
50
56
  if (currentOrientation != newConfig.orientation) {
51
57
  currentOrientation = newConfig.orientation;
52
58
  notifyOrientationChange();
@@ -11,7 +11,7 @@ import UIKit
11
11
  */
12
12
  @objc(CapacitorScreenOrientationPlugin)
13
13
  public class CapacitorScreenOrientationPlugin: CAPPlugin, CAPBridgedPlugin {
14
- private let pluginVersion: String = "8.1.4"
14
+ private let pluginVersion: String = "8.1.6"
15
15
  public let identifier = "CapacitorScreenOrientationPlugin"
16
16
  public let jsName = "CapacitorScreenOrientation"
17
17
  public let pluginMethods: [CAPPluginMethod] = [
@@ -49,6 +49,10 @@ public class CapacitorScreenOrientationPlugin: CAPPlugin, CAPBridgedPlugin {
49
49
  }
50
50
 
51
51
  @objc private func orientationDidChange() {
52
+ // Skip system orientation changes when motion tracking is active
53
+ // to avoid duplicate events
54
+ guard !isTrackingWithMotion else { return }
55
+
52
56
  let orientation = UIDevice.current.orientation
53
57
  if orientation.isValidInterfaceOrientation {
54
58
  notifyOrientationChange(fromDeviceOrientation: orientation)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/capacitor-screen-orientation",
3
- "version": "8.1.4",
3
+ "version": "8.1.6",
4
4
  "description": "Screen orientation plugin with support for bypassing orientation lock",
5
5
  "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",