expo-screen-orientation 9.0.9-canary-20260105-6b962e6 → 9.0.9-canary-20260113-0ce2b9c

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +1 -0
  2. package/android/build.gradle +2 -2
  3. package/build/ExpoScreenOrientation.web.d.ts +1 -2
  4. package/build/ExpoScreenOrientation.web.d.ts.map +1 -1
  5. package/build/ExpoScreenOrientation.web.js +9 -11
  6. package/build/ExpoScreenOrientation.web.js.map +1 -1
  7. package/expo-module.config.json +1 -1
  8. package/ios/ScreenOrientationRegistry.swift +1 -4
  9. package/ios/ScreenOrientationViewController.swift +7 -1
  10. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.module → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.module} +7 -7
  11. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.module.md5 +1 -0
  12. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.module.sha1 +1 -0
  13. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.module.sha256 +1 -0
  14. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.module.sha512 +1 -0
  15. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.pom → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.pom} +1 -1
  16. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.pom.md5 +1 -0
  17. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.pom.sha1 +1 -0
  18. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.pom.sha256 +1 -0
  19. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.pom.sha512 +1 -0
  20. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml +4 -4
  21. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.md5 +1 -1
  22. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha1 +1 -1
  23. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha256 +1 -1
  24. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/maven-metadata.xml.sha512 +1 -1
  25. package/package.json +3 -3
  26. package/src/ExpoScreenOrientation.web.ts +9 -11
  27. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.module.md5 +0 -1
  28. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.module.sha1 +0 -1
  29. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.module.sha256 +0 -1
  30. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.module.sha512 +0 -1
  31. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.pom.md5 +0 -1
  32. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.pom.sha1 +0 -1
  33. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.pom.sha256 +0 -1
  34. package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.pom.sha512 +0 -1
  35. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar} +0 -0
  36. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar.md5 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar.md5} +0 -0
  37. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar.sha1 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar.sha1} +0 -0
  38. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar.sha256 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar.sha256} +0 -0
  39. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar.sha512 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar.sha512} +0 -0
  40. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar} +0 -0
  41. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar.md5 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar.md5} +0 -0
  42. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar.sha1 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar.sha1} +0 -0
  43. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar.sha256 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar.sha256} +0 -0
  44. /package/local-maven-repo/host/exp/exponent/expo.modules.screenorientation/{9.0.9-canary-20260105-6b962e6/expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar.sha512 → 9.0.9-canary-20260113-0ce2b9c/expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar.sha512} +0 -0
package/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@
9
9
  ### 🐛 Bug fixes
10
10
 
11
11
  - [web] fix undeclared `listener` reference ([#41441](https://github.com/expo/expo/pull/41441) by [@vonovak](https://github.com/vonovak))
12
+ - [iOS] Remove use of deprecated API `UIApplication.shared.windows`. ([#40881](https://github.com/expo/expo/pull/40881) by [@bwallberg](https://github.com/bwallberg))
12
13
 
13
14
  ### 💡 Others
14
15
 
@@ -4,12 +4,12 @@ plugins {
4
4
  }
5
5
 
6
6
  group = 'host.exp.exponent'
7
- version = '9.0.9-canary-20260105-6b962e6'
7
+ version = '9.0.9-canary-20260113-0ce2b9c'
8
8
 
9
9
  android {
10
10
  namespace "expo.modules.screenorientation"
11
11
  defaultConfig {
12
12
  versionCode 7
13
- versionName '9.0.9-canary-20260105-6b962e6'
13
+ versionName '9.0.9-canary-20260113-0ce2b9c'
14
14
  }
15
15
  }
@@ -11,8 +11,7 @@ declare global {
11
11
  }
12
12
  declare class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
13
13
  orientation: ScreenOrientation | null;
14
- listener: (() => void) | undefined;
15
- emitOrientationEvent(): Promise<void>;
14
+ emitOrientationEvent: () => Promise<void>;
16
15
  startObserving(): void;
17
16
  stopObserving(): void;
18
17
  supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoScreenOrientation.web.d.ts","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAElB,qBAAqB,EACtB,MAAM,2BAA2B,CAAC;AA2CnC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,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AC9C,cAAc,CAAC,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;QAEvC,oBAAoB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC7C,mBAAmB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;QAC5C,iBAAiB,CAAC,IAAI,OAAO,GAAG,SAAS,CAAC;KAC3C;CACF;AA+CD,cAAM,qBAAsB,SAAQ,YAAY,CAAC,qBAAqB,CAAC;IACrE,WAAW,EAAE,iBAAiB,GAAG,IAAI,CAE5B;IAET,oBAAoB,sBASlB;IACF,cAAc;IASd,aAAa,IAAI,IAAI;IASf,4BAA4B,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC;IAGhF,+BAA+B,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAG9D,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;IAQ3C,SAAS,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAO1D,iBAAiB,CAAC,kBAAkB,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAIxE,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;CA8BnC;;AAED,wBAAiF"}
@@ -63,8 +63,7 @@ class ExpoScreenOrientation extends NativeModule {
63
63
  orientation = Platform.canUseViewport
64
64
  ? screen.orientation || screen.msOrientation || null
65
65
  : null;
66
- listener;
67
- async emitOrientationEvent() {
66
+ emitOrientationEvent = async () => {
68
67
  const [orientationLock, orientation] = await Promise.all([
69
68
  getOrientationLockAsync(),
70
69
  getOrientationAsync(),
@@ -73,25 +72,24 @@ class ExpoScreenOrientation extends NativeModule {
73
72
  orientationLock,
74
73
  orientationInfo: { orientation },
75
74
  });
76
- }
75
+ };
77
76
  startObserving() {
78
- this.listener = () => this.emitOrientationEvent();
79
77
  if (Platform.canUseEventListeners) {
80
- if (this.orientation && this.orientation.addEventListener) {
81
- this.orientation.addEventListener('change', this.listener);
78
+ if (this.orientation?.addEventListener) {
79
+ this.orientation.addEventListener('change', this.emitOrientationEvent);
82
80
  }
83
81
  else {
84
- window.addEventListener('orientationchange', this.listener);
82
+ window.addEventListener('orientationchange', this.emitOrientationEvent);
85
83
  }
86
84
  }
87
85
  }
88
86
  stopObserving() {
89
- if (Platform.canUseEventListeners && this.listener) {
90
- if (this.orientation && this.orientation.removeEventListener) {
91
- this.orientation.removeEventListener('change', this.listener);
87
+ if (Platform.canUseEventListeners) {
88
+ if (this.orientation?.removeEventListener) {
89
+ this.orientation.removeEventListener('change', this.emitOrientationEvent);
92
90
  }
93
91
  else {
94
- window.removeEventListener('orientationchange', this.listener);
92
+ window.removeEventListener('orientationchange', this.emitOrientationEvent);
95
93
  }
96
94
  }
97
95
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoScreenOrientation.web.js","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAEnC,MAAM,uBAAuB,GAEzB;IACF,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO;IACrD,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,GAAG;IAC7C,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,QAAQ;IACvD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,gBAAgB;IAClE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,kBAAkB;IACtE,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,SAAS;IACzD,CAAC,eAAe,CAAC,cAAc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D,KAAK,CAAC,SAAS,CAAC,eAAgC;QAC9C,MAAM,kBAAkB,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;QACpE,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,MAAM,IAAI,SAAS,CAAC,6BAA6B,eAAe,EAAE,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,UAAU,CAAC,kBAAkB,CAAC,CAAC;IACvC,CAAC;IACD,KAAK,CAAC,iBAAiB,CAAC,kBAAsC;QAC5D,MAAM,UAAU,CAAC,kBAAkB,CAAC,CAAC;QACrC,uBAAuB,GAAG,kBAAkB,CAAC;IAC/C,CAAC;IACD,KAAK,CAAC,WAAW;QACf,oCAAoC;QACpC,iFAAiF;QACjF,IACE,MAAM,CAAC,WAAW;YAClB,QAAQ,IAAI,MAAM,CAAC,WAAW;YAC9B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,UAAU,EAC/C,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,iFAAiF;QACjF,MAAM,sBAAsB,GAC1B,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,oBAAoB,IAAI,MAAM,CAAC,mBAAmB,CAAC;QAExF,sCAAsC;QACtC,iFAAiF;QACjF,IAAI,OAAO,sBAAsB,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { NativeModule, Platform, registerWebModule } from 'expo-modules-core';\n\nimport { getOrientationLockAsync, getOrientationAsync } from './ScreenOrientation';\nimport {\n Orientation,\n OrientationLock,\n WebOrientationLock,\n WebOrientation,\n ExpoOrientationEvents,\n} from './ScreenOrientation.types';\n\nconst OrientationLockAPIToWeb: {\n [lock: string]: WebOrientationLock;\n} = {\n [OrientationLock.DEFAULT]: WebOrientationLock.NATURAL,\n [OrientationLock.ALL]: WebOrientationLock.ANY,\n [OrientationLock.PORTRAIT]: WebOrientationLock.PORTRAIT,\n [OrientationLock.PORTRAIT_UP]: WebOrientationLock.PORTRAIT_PRIMARY,\n [OrientationLock.PORTRAIT_DOWN]: WebOrientationLock.PORTRAIT_SECONDARY,\n [OrientationLock.LANDSCAPE]: WebOrientationLock.LANDSCAPE,\n [OrientationLock.LANDSCAPE_LEFT]: WebOrientationLock.LANDSCAPE_PRIMARY,\n [OrientationLock.LANDSCAPE_RIGHT]: WebOrientationLock.LANDSCAPE_SECONDARY,\n};\n\nconst OrientationWebToAPI: {\n [orientationWeb: string]: Orientation;\n} = {\n [WebOrientation.PORTRAIT_PRIMARY]: Orientation.PORTRAIT_UP,\n [WebOrientation.PORTRAIT_SECONDARY]: Orientation.PORTRAIT_DOWN,\n [WebOrientation.LANDSCAPE_PRIMARY]: Orientation.LANDSCAPE_LEFT,\n [WebOrientation.LANDSCAPE_SECONDARY]: Orientation.LANDSCAPE_RIGHT,\n};\n\ndeclare const window: Window;\n\nconst screen: Screen = Platform.canUseViewport ? window.screen : ({} as Screen);\n\nfunction _convertToLegacyOrientationLock(orientationLock: WebOrientationLock) {\n switch (orientationLock) {\n case WebOrientationLock.UNKNOWN:\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock to be converted.`\n );\n case WebOrientationLock.ANY:\n return ['portrait', 'landscape'];\n case WebOrientationLock.NATURAL:\n return 'default';\n default:\n return orientationLock;\n }\n}\n\ndeclare global {\n interface Screen {\n msOrientation?: Screen['orientation']['type'];\n mozOrientation?: Screen['orientation'];\n\n mozUnlockOrientation?(): boolean | undefined;\n msUnlockOrientation?(): boolean | undefined;\n unlockOrientation?(): boolean | undefined;\n }\n}\n\nasync function _lockAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n if (webOrientationLock === WebOrientationLock.UNKNOWN) {\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock that can be applied to the device.`\n );\n }\n\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock\n if (\n screen.orientation &&\n 'lock' in screen.orientation &&\n typeof screen.orientation.lock === 'function'\n ) {\n await screen.orientation.lock(webOrientationLock);\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n const _legacyLockUniversal:\n | undefined\n | ((orientation: ReturnType<typeof _convertToLegacyOrientationLock>) => boolean) =\n // @ts-expect-error - These legacy APIs are removed from the types\n screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n if (typeof _legacyLockUniversal === 'function') {\n const legacyLock = _convertToLegacyOrientationLock(webOrientationLock);\n const isSuccess = _legacyLockUniversal.call(screen, legacyLock);\n if (!isSuccess) {\n throw new Error(\n `Applying orientation lock: ${JSON.stringify(webOrientationLock)} to device was denied`\n );\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support locking screen orientation.`\n );\n}\n\nlet _lastWebOrientationLock: WebOrientationLock = WebOrientationLock.UNKNOWN;\n\nclass ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {\n orientation: ScreenOrientation | null = Platform.canUseViewport\n ? screen.orientation || (screen as any).msOrientation || null\n : null;\n listener: (() => void) | undefined;\n\n async emitOrientationEvent() {\n const [orientationLock, orientation] = await Promise.all([\n getOrientationLockAsync(),\n getOrientationAsync(),\n ]);\n this.emit('expoDidUpdateDimensions', {\n orientationLock,\n orientationInfo: { orientation },\n });\n }\n startObserving() {\n this.listener = () => this.emitOrientationEvent();\n if (Platform.canUseEventListeners) {\n if (this.orientation && this.orientation.addEventListener) {\n this.orientation.addEventListener('change', this.listener);\n } else {\n window.addEventListener('orientationchange', this.listener);\n }\n }\n }\n stopObserving(): void {\n if (Platform.canUseEventListeners && this.listener) {\n if (this.orientation && this.orientation.removeEventListener) {\n this.orientation.removeEventListener('change', this.listener);\n } else {\n window.removeEventListener('orientationchange', this.listener);\n }\n }\n }\n async supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean> {\n return orientationLock in OrientationLockAPIToWeb;\n }\n async getPlatformOrientationLockAsync(): Promise<WebOrientationLock> {\n return _lastWebOrientationLock;\n }\n async getOrientationAsync(): Promise<Orientation> {\n const webOrientation =\n screen['msOrientation'] || (screen.orientation || screen['mozOrientation'] || {}).type;\n if (!webOrientation) {\n return Orientation.UNKNOWN;\n }\n return OrientationWebToAPI[webOrientation];\n }\n async lockAsync(orientationLock: OrientationLock): Promise<void> {\n const webOrientationLock = OrientationLockAPIToWeb[orientationLock];\n if (!webOrientationLock) {\n throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);\n }\n await _lockAsync(webOrientationLock);\n }\n async lockPlatformAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n await _lockAsync(webOrientationLock);\n _lastWebOrientationLock = webOrientationLock;\n }\n async unlockAsync(): Promise<void> {\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock\n if (\n screen.orientation &&\n 'unlock' in screen.orientation &&\n typeof screen.orientation.unlock === 'function'\n ) {\n screen.orientation.unlock();\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n const _legacyUnlockUniversal: undefined | (() => boolean | undefined) =\n screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n if (typeof _legacyUnlockUniversal === 'function') {\n const isSuccess = _legacyUnlockUniversal.call(screen);\n if (!isSuccess) {\n throw new Error(`Unlocking screen orientation on device was denied`);\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support unlocking screen orientation.`\n );\n }\n}\n\nexport default registerWebModule(ExpoScreenOrientation, 'ExpoScreenOrientation');\n"]}
1
+ {"version":3,"file":"ExpoScreenOrientation.web.js","sourceRoot":"","sources":["../src/ExpoScreenOrientation.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACnF,OAAO,EACL,WAAW,EACX,eAAe,EACf,kBAAkB,EAClB,cAAc,GAEf,MAAM,2BAA2B,CAAC;AAEnC,MAAM,uBAAuB,GAEzB;IACF,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,kBAAkB,CAAC,OAAO;IACrD,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,kBAAkB,CAAC,GAAG;IAC7C,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,kBAAkB,CAAC,QAAQ;IACvD,CAAC,eAAe,CAAC,WAAW,CAAC,EAAE,kBAAkB,CAAC,gBAAgB;IAClE,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,kBAAkB,CAAC,kBAAkB;IACtE,CAAC,eAAe,CAAC,SAAS,CAAC,EAAE,kBAAkB,CAAC,SAAS;IACzD,CAAC,eAAe,CAAC,cAAc,CAAC,EAAE,kBAAkB,CAAC,iBAAiB;IACtE,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,kBAAkB,CAAC,mBAAmB;CAC1E,CAAC;AAEF,MAAM,mBAAmB,GAErB;IACF,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC,WAAW;IAC1D,CAAC,cAAc,CAAC,kBAAkB,CAAC,EAAE,WAAW,CAAC,aAAa;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ACf,oCAAoC;QACpC,iFAAiF;QACjF,IACE,MAAM,CAAC,WAAW;YAClB,QAAQ,IAAI,MAAM,CAAC,WAAW;YAC9B,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,UAAU,EAC/C,CAAC;YACD,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,iFAAiF;QACjF,MAAM,sBAAsB,GAC1B,MAAM,CAAC,iBAAiB,IAAI,MAAM,CAAC,oBAAoB,IAAI,MAAM,CAAC,mBAAmB,CAAC;QAExF,sCAAsC;QACtC,iFAAiF;QACjF,IAAI,OAAO,sBAAsB,KAAK,UAAU,EAAE,CAAC;YACjD,MAAM,SAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACtD,IAAI,CAAC,SAAS,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;YACvE,CAAC;YACD,OAAO;QACT,CAAC;QAED,MAAM,IAAI,KAAK,CACb,oFAAoF,CACrF,CAAC;IACJ,CAAC;CACF;AAED,eAAe,iBAAiB,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { NativeModule, Platform, registerWebModule } from 'expo-modules-core';\n\nimport { getOrientationLockAsync, getOrientationAsync } from './ScreenOrientation';\nimport {\n Orientation,\n OrientationLock,\n WebOrientationLock,\n WebOrientation,\n ExpoOrientationEvents,\n} from './ScreenOrientation.types';\n\nconst OrientationLockAPIToWeb: {\n [lock: string]: WebOrientationLock;\n} = {\n [OrientationLock.DEFAULT]: WebOrientationLock.NATURAL,\n [OrientationLock.ALL]: WebOrientationLock.ANY,\n [OrientationLock.PORTRAIT]: WebOrientationLock.PORTRAIT,\n [OrientationLock.PORTRAIT_UP]: WebOrientationLock.PORTRAIT_PRIMARY,\n [OrientationLock.PORTRAIT_DOWN]: WebOrientationLock.PORTRAIT_SECONDARY,\n [OrientationLock.LANDSCAPE]: WebOrientationLock.LANDSCAPE,\n [OrientationLock.LANDSCAPE_LEFT]: WebOrientationLock.LANDSCAPE_PRIMARY,\n [OrientationLock.LANDSCAPE_RIGHT]: WebOrientationLock.LANDSCAPE_SECONDARY,\n};\n\nconst OrientationWebToAPI: {\n [orientationWeb: string]: Orientation;\n} = {\n [WebOrientation.PORTRAIT_PRIMARY]: Orientation.PORTRAIT_UP,\n [WebOrientation.PORTRAIT_SECONDARY]: Orientation.PORTRAIT_DOWN,\n [WebOrientation.LANDSCAPE_PRIMARY]: Orientation.LANDSCAPE_LEFT,\n [WebOrientation.LANDSCAPE_SECONDARY]: Orientation.LANDSCAPE_RIGHT,\n};\n\ndeclare const window: Window;\n\nconst screen: Screen = Platform.canUseViewport ? window.screen : ({} as Screen);\n\nfunction _convertToLegacyOrientationLock(orientationLock: WebOrientationLock) {\n switch (orientationLock) {\n case WebOrientationLock.UNKNOWN:\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock to be converted.`\n );\n case WebOrientationLock.ANY:\n return ['portrait', 'landscape'];\n case WebOrientationLock.NATURAL:\n return 'default';\n default:\n return orientationLock;\n }\n}\n\ndeclare global {\n interface Screen {\n msOrientation?: Screen['orientation']['type'];\n mozOrientation?: Screen['orientation'];\n\n mozUnlockOrientation?(): boolean | undefined;\n msUnlockOrientation?(): boolean | undefined;\n unlockOrientation?(): boolean | undefined;\n }\n}\n\nasync function _lockAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n if (webOrientationLock === WebOrientationLock.UNKNOWN) {\n throw new Error(\n `expo-screen-orientation: WebOrientationLock.UNKNOWN is not a valid lock that can be applied to the device.`\n );\n }\n\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/lock\n if (\n screen.orientation &&\n 'lock' in screen.orientation &&\n typeof screen.orientation.lock === 'function'\n ) {\n await screen.orientation.lock(webOrientationLock);\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n const _legacyLockUniversal:\n | undefined\n | ((orientation: ReturnType<typeof _convertToLegacyOrientationLock>) => boolean) =\n // @ts-expect-error - These legacy APIs are removed from the types\n screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/lockOrientation\n if (typeof _legacyLockUniversal === 'function') {\n const legacyLock = _convertToLegacyOrientationLock(webOrientationLock);\n const isSuccess = _legacyLockUniversal.call(screen, legacyLock);\n if (!isSuccess) {\n throw new Error(\n `Applying orientation lock: ${JSON.stringify(webOrientationLock)} to device was denied`\n );\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support locking screen orientation.`\n );\n}\n\nlet _lastWebOrientationLock: WebOrientationLock = WebOrientationLock.UNKNOWN;\n\nclass ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {\n orientation: ScreenOrientation | null = Platform.canUseViewport\n ? screen.orientation || (screen as any).msOrientation || null\n : null;\n\n emitOrientationEvent = async () => {\n const [orientationLock, orientation] = await Promise.all([\n getOrientationLockAsync(),\n getOrientationAsync(),\n ]);\n this.emit('expoDidUpdateDimensions', {\n orientationLock,\n orientationInfo: { orientation },\n });\n };\n startObserving() {\n if (Platform.canUseEventListeners) {\n if (this.orientation?.addEventListener) {\n this.orientation.addEventListener('change', this.emitOrientationEvent);\n } else {\n window.addEventListener('orientationchange', this.emitOrientationEvent);\n }\n }\n }\n stopObserving(): void {\n if (Platform.canUseEventListeners) {\n if (this.orientation?.removeEventListener) {\n this.orientation.removeEventListener('change', this.emitOrientationEvent);\n } else {\n window.removeEventListener('orientationchange', this.emitOrientationEvent);\n }\n }\n }\n async supportsOrientationLockAsync(orientationLock: OrientationLock): Promise<boolean> {\n return orientationLock in OrientationLockAPIToWeb;\n }\n async getPlatformOrientationLockAsync(): Promise<WebOrientationLock> {\n return _lastWebOrientationLock;\n }\n async getOrientationAsync(): Promise<Orientation> {\n const webOrientation =\n screen['msOrientation'] || (screen.orientation || screen['mozOrientation'] || {}).type;\n if (!webOrientation) {\n return Orientation.UNKNOWN;\n }\n return OrientationWebToAPI[webOrientation];\n }\n async lockAsync(orientationLock: OrientationLock): Promise<void> {\n const webOrientationLock = OrientationLockAPIToWeb[orientationLock];\n if (!webOrientationLock) {\n throw new TypeError(`Invalid Orientation Lock: ${orientationLock}`);\n }\n await _lockAsync(webOrientationLock);\n }\n async lockPlatformAsync(webOrientationLock: WebOrientationLock): Promise<void> {\n await _lockAsync(webOrientationLock);\n _lastWebOrientationLock = webOrientationLock;\n }\n async unlockAsync(): Promise<void> {\n // Handle modern lock screen web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/ScreenOrientation/unlock\n if (\n screen.orientation &&\n 'unlock' in screen.orientation &&\n typeof screen.orientation.unlock === 'function'\n ) {\n screen.orientation.unlock();\n return;\n }\n\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n const _legacyUnlockUniversal: undefined | (() => boolean | undefined) =\n screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation;\n\n // Fallback to outdated legacy web API\n // See: https://developer.mozilla.org/en-US/docs/Web/API/Screen/unlockOrientation\n if (typeof _legacyUnlockUniversal === 'function') {\n const isSuccess = _legacyUnlockUniversal.call(screen);\n if (!isSuccess) {\n throw new Error(`Unlocking screen orientation on device was denied`);\n }\n return;\n }\n\n throw new Error(\n `expo-screen-orientation: The browser doesn't support unlocking screen orientation.`\n );\n }\n}\n\nexport default registerWebModule(ExpoScreenOrientation, 'ExpoScreenOrientation');\n"]}
@@ -10,7 +10,7 @@
10
10
  "publication": {
11
11
  "groupId": "host.exp.exponent",
12
12
  "artifactId": "expo.modules.screenorientation",
13
- "version": "9.0.9-canary-20260105-6b962e6",
13
+ "version": "9.0.9-canary-20260113-0ce2b9c",
14
14
  "repository": "local-maven-repo"
15
15
  }
16
16
  }
@@ -57,10 +57,7 @@ public class ScreenOrientationRegistry: NSObject, UIApplicationDelegate {
57
57
  Called by ScreenOrientationAppDelegate in order to set initial interface orientation.
58
58
  */
59
59
  public func updateCurrentScreenOrientation() {
60
- let windows = UIApplication.shared.windows
61
- if !windows.isEmpty {
62
- self.currentScreenOrientation = windows[0].windowScene?.interfaceOrientation ?? .unknown
63
- }
60
+ self.currentScreenOrientation = rootViewController?.view.window?.windowScene?.interfaceOrientation ?? .unknown
64
61
  }
65
62
 
66
63
  deinit {
@@ -9,7 +9,13 @@ class ScreenOrientationViewController: UIViewController {
9
9
  private var defaultOrientationMask: UIInterfaceOrientationMask
10
10
  private var previousInterfaceOrientation: UIInterfaceOrientation = .unknown
11
11
  private var windowInterfaceOrientation: UIInterfaceOrientation? {
12
- return UIApplication.shared.windows.first?.windowScene?.interfaceOrientation
12
+ let keyWindow = UIApplication
13
+ .shared
14
+ .connectedScenes
15
+ .flatMap { ($0 as? UIWindowScene)?.windows ?? [] }
16
+ .last { $0.isKeyWindow }
17
+
18
+ return keyWindow?.windowScene?.interfaceOrientation
13
19
  }
14
20
 
15
21
  init(defaultOrientationMask: UIInterfaceOrientationMask = doesDeviceHaveNotch ? .allButUpsideDown : .all) {
@@ -3,7 +3,7 @@
3
3
  "component": {
4
4
  "group": "host.exp.exponent",
5
5
  "module": "expo.modules.screenorientation",
6
- "version": "9.0.9-canary-20260105-6b962e6",
6
+ "version": "9.0.9-canary-20260113-0ce2b9c",
7
7
  "attributes": {
8
8
  "org.gradle.status": "release"
9
9
  }
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "files": [
26
26
  {
27
- "name": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar",
28
- "url": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar",
27
+ "name": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar",
28
+ "url": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar",
29
29
  "size": 36365,
30
30
  "sha512": "79b78c175584bffc9070c529309e89373b6a0296abeecfb2153b23662326ef1d045f940985aaf4fad2b31941c5157974b79c2836cdfc66b05ed574d681028eee",
31
31
  "sha256": "d6772ad24c27669f8d32e5179d91f63854c9f04fdb856021a918f2b41af6653d",
@@ -53,8 +53,8 @@
53
53
  ],
54
54
  "files": [
55
55
  {
56
- "name": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar",
57
- "url": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6.aar",
56
+ "name": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar",
57
+ "url": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c.aar",
58
58
  "size": 36365,
59
59
  "sha512": "79b78c175584bffc9070c529309e89373b6a0296abeecfb2153b23662326ef1d045f940985aaf4fad2b31941c5157974b79c2836cdfc66b05ed574d681028eee",
60
60
  "sha256": "d6772ad24c27669f8d32e5179d91f63854c9f04fdb856021a918f2b41af6653d",
@@ -73,8 +73,8 @@
73
73
  },
74
74
  "files": [
75
75
  {
76
- "name": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar",
77
- "url": "expo.modules.screenorientation-9.0.9-canary-20260105-6b962e6-sources.jar",
76
+ "name": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar",
77
+ "url": "expo.modules.screenorientation-9.0.9-canary-20260113-0ce2b9c-sources.jar",
78
78
  "size": 5194,
79
79
  "sha512": "e06be0d0236539250b81b1d5670d89f70600b03c82fa53c245602afdcb2bab06d04d42e6dd85e9686867d069a8b09dd3fbc04f562bc1760e33f68ea614b2ec42",
80
80
  "sha256": "d63ace679c73e409ffd1706ac43973134e9151254bf644d73a33c27539db1037",
@@ -0,0 +1 @@
1
+ cc36e1e9d718ff4268dbda5679a1783a2a911a6b8661f7226bde460caacefb4f8a9ad5ccb30fe1a77f824ddedb5e979ef7565262b603b1229b4fa9f651a324ab
@@ -9,7 +9,7 @@
9
9
  <modelVersion>4.0.0</modelVersion>
10
10
  <groupId>host.exp.exponent</groupId>
11
11
  <artifactId>expo.modules.screenorientation</artifactId>
12
- <version>9.0.9-canary-20260105-6b962e6</version>
12
+ <version>9.0.9-canary-20260113-0ce2b9c</version>
13
13
  <packaging>aar</packaging>
14
14
  <name>expo.modules.screenorientation</name>
15
15
  <url>https://github.com/expo/expo</url>
@@ -0,0 +1 @@
1
+ c582e268a11a278201692c5ff70cf43c3e6f1fb81d44dd0a2906f25cb443997348814deea110d9c142699d1b3f9b3982ec43ce340764ab606c7a13aa74db592a
@@ -3,11 +3,11 @@
3
3
  <groupId>host.exp.exponent</groupId>
4
4
  <artifactId>expo.modules.screenorientation</artifactId>
5
5
  <versioning>
6
- <latest>9.0.9-canary-20260105-6b962e6</latest>
7
- <release>9.0.9-canary-20260105-6b962e6</release>
6
+ <latest>9.0.9-canary-20260113-0ce2b9c</latest>
7
+ <release>9.0.9-canary-20260113-0ce2b9c</release>
8
8
  <versions>
9
- <version>9.0.9-canary-20260105-6b962e6</version>
9
+ <version>9.0.9-canary-20260113-0ce2b9c</version>
10
10
  </versions>
11
- <lastUpdated>20260105102039</lastUpdated>
11
+ <lastUpdated>20260113181535</lastUpdated>
12
12
  </versioning>
13
13
  </metadata>
@@ -1 +1 @@
1
- 4b1a69bdf5b5edabb8150573c9bd9ed0
1
+ 97fac0209aff2b70ca55348f5ab473dc
@@ -1 +1 @@
1
- f961d7456279b8e772a2e41be6a0ccef6497b027
1
+ 4410a2b2a6b6c81714058de16ff2196b3447b80f
@@ -1 +1 @@
1
- f24b4dd3bbdedf2a55268fccee5b9d39bff91c997a58b216f4ffcec1c95d9267
1
+ ddf7e665d60c545d31c7521620dd21bdc0e601e19631a7338247e6894826b3c2
@@ -1 +1 @@
1
- d227e2f1e51e0cf2a0caba003745718348b1afa0cba76276f26844c547ebd705ba3ade580a43c222e7d90df7c86c7ef8e35bfb2db652efe6e49ee9e848f787c4
1
+ 87e8f89e125b94d733036ecc28122c108242b793d3fcb4a56990030a4eb2c70dad59aaf227f46a5116232e20cc19cc42f0bcbe10bcc4d33cb9ad7915b7af027f
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-screen-orientation",
3
- "version": "9.0.9-canary-20260105-6b962e6",
3
+ "version": "9.0.9-canary-20260113-0ce2b9c",
4
4
  "description": "Expo universal module for managing device's screen orientation",
5
5
  "main": "build/ScreenOrientation.js",
6
6
  "types": "build/ScreenOrientation.d.ts",
@@ -36,10 +36,10 @@
36
36
  "preset": "expo-module-scripts"
37
37
  },
38
38
  "devDependencies": {
39
- "expo-module-scripts": "5.1.0-canary-20260105-6b962e6"
39
+ "expo-module-scripts": "5.1.0-canary-20260113-0ce2b9c"
40
40
  },
41
41
  "peerDependencies": {
42
- "expo": "55.0.0-canary-20260105-6b962e6",
42
+ "expo": "55.0.0-canary-20260113-0ce2b9c",
43
43
  "react-native": "*"
44
44
  }
45
45
  }
@@ -110,9 +110,8 @@ class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
110
110
  orientation: ScreenOrientation | null = Platform.canUseViewport
111
111
  ? screen.orientation || (screen as any).msOrientation || null
112
112
  : null;
113
- listener: (() => void) | undefined;
114
113
 
115
- async emitOrientationEvent() {
114
+ emitOrientationEvent = async () => {
116
115
  const [orientationLock, orientation] = await Promise.all([
117
116
  getOrientationLockAsync(),
118
117
  getOrientationAsync(),
@@ -121,23 +120,22 @@ class ExpoScreenOrientation extends NativeModule<ExpoOrientationEvents> {
121
120
  orientationLock,
122
121
  orientationInfo: { orientation },
123
122
  });
124
- }
123
+ };
125
124
  startObserving() {
126
- this.listener = () => this.emitOrientationEvent();
127
125
  if (Platform.canUseEventListeners) {
128
- if (this.orientation && this.orientation.addEventListener) {
129
- this.orientation.addEventListener('change', this.listener);
126
+ if (this.orientation?.addEventListener) {
127
+ this.orientation.addEventListener('change', this.emitOrientationEvent);
130
128
  } else {
131
- window.addEventListener('orientationchange', this.listener);
129
+ window.addEventListener('orientationchange', this.emitOrientationEvent);
132
130
  }
133
131
  }
134
132
  }
135
133
  stopObserving(): void {
136
- if (Platform.canUseEventListeners && this.listener) {
137
- if (this.orientation && this.orientation.removeEventListener) {
138
- this.orientation.removeEventListener('change', this.listener);
134
+ if (Platform.canUseEventListeners) {
135
+ if (this.orientation?.removeEventListener) {
136
+ this.orientation.removeEventListener('change', this.emitOrientationEvent);
139
137
  } else {
140
- window.removeEventListener('orientationchange', this.listener);
138
+ window.removeEventListener('orientationchange', this.emitOrientationEvent);
141
139
  }
142
140
  }
143
141
  }
@@ -1 +0,0 @@
1
- c02de752d3927b92346a3855e6e856bad7201c7264ba8351fdd33081feb853f696942047ec3fb11b37d14e568551e880509adda5a895666d903589f6b95445c9
@@ -1 +0,0 @@
1
- 9013557a29fc855dd9579fd40b944b0773a6156febdf0e5881cadbae5528548bbf3c87a2e2f09d5999f8408c3d3918e82911784fe7dd1019b12dc93b62eeb3d6