expo-splash-screen 0.29.1 → 0.29.3

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/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.29.3 — 2024-11-06
14
+
15
+ _This version does not introduce any user-facing changes._
16
+
17
+ ## 0.29.2 — 2024-11-05
18
+
19
+ ### 💡 Others
20
+
21
+ - Migrate internal logic used by router from JS to native ([#32610](https://github.com/expo/expo/pull/32610) by [@brentvatne](https://github.com/brentvatne))
22
+
13
23
  ## 0.29.1 — 2024-10-31
14
24
 
15
25
  _This version does not introduce any user-facing changes._
@@ -1,7 +1,7 @@
1
1
  apply plugin: 'com.android.library'
2
2
 
3
3
  group = 'host.exp.exponent'
4
- version = '0.29.1'
4
+ version = '0.29.3'
5
5
 
6
6
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
7
  apply from: expoModulesCorePlugin
@@ -14,7 +14,7 @@ android {
14
14
  namespace "expo.modules.splashscreen"
15
15
  defaultConfig {
16
16
  versionCode 17
17
- versionName '0.29.1'
17
+ versionName '0.29.3'
18
18
  }
19
19
  }
20
20
 
@@ -15,10 +15,20 @@ class SplashScreenOptions : Record {
15
15
  }
16
16
 
17
17
  class SplashScreenModule : Module() {
18
+ private var userControlledAutoHideEnabled: Boolean = false
19
+
18
20
  override fun definition() = ModuleDefinition {
19
21
  Name("ExpoSplashScreen")
20
22
 
21
23
  AsyncFunction<Unit>("preventAutoHideAsync") {
24
+ // The user has manually invoked prevent autohide, this is used to allow libraries
25
+ // such as expo-router to know whether it's safe to hide or if they should wait for
26
+ // the user to do it.
27
+ userControlledAutoHideEnabled = true
28
+ SplashScreenManager.preventAutoHideCalled = true
29
+ }
30
+
31
+ AsyncFunction<Unit>("internalPreventAutoHideAsync") {
22
32
  SplashScreenManager.preventAutoHideCalled = true
23
33
  }
24
34
 
@@ -38,6 +48,12 @@ class SplashScreenModule : Module() {
38
48
  SplashScreenManager.hide()
39
49
  }
40
50
 
51
+ AsyncFunction("internalMaybeHideAsync") {
52
+ if (!userControlledAutoHideEnabled) {
53
+ SplashScreenManager.hide()
54
+ }
55
+ }
56
+
41
57
  OnDestroy {
42
58
  SplashScreenManager.unregisterContentAppearedListener()
43
59
  }
@@ -17,5 +17,7 @@ export interface SplashScreenNativeModule extends NativeModule {
17
17
  preventAutoHideAsync: () => Promise<boolean>;
18
18
  hide: () => void;
19
19
  hideAsync: () => Promise<void>;
20
+ _internal_maybeHideAsync: () => Promise<void>;
21
+ _internal_preventAutoHideAsync: () => Promise<boolean>;
20
22
  }
21
23
  //# sourceMappingURL=SplashScreen.types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SplashScreen.types.d.ts","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,UAAU,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAChC"}
1
+ {"version":3,"file":"SplashScreen.types.d.ts","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,UAAU,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;IACnD,oBAAoB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,SAAS,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/B,wBAAwB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C,8BAA8B,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"SplashScreen.types.js","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule } from 'expo-modules-core/types';\n\nexport type SplashScreenOptions = {\n /**\n * The duration of the fade out animation in milliseconds.\n * @default 400\n */\n duration?: number;\n /**\n * Whether to hide the splash screen with a fade out animation.\n * @ios\n * @default false\n */\n fade?: boolean;\n};\n\nexport interface SplashScreenNativeModule extends NativeModule {\n setOptions: (options: SplashScreenOptions) => void;\n preventAutoHideAsync: () => Promise<boolean>;\n hide: () => void;\n hideAsync: () => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"SplashScreen.types.js","sourceRoot":"","sources":["../src/SplashScreen.types.ts"],"names":[],"mappings":"","sourcesContent":["import { NativeModule } from 'expo-modules-core/types';\n\nexport type SplashScreenOptions = {\n /**\n * The duration of the fade out animation in milliseconds.\n * @default 400\n */\n duration?: number;\n /**\n * Whether to hide the splash screen with a fade out animation.\n * @ios\n * @default false\n */\n fade?: boolean;\n};\n\nexport interface SplashScreenNativeModule extends NativeModule {\n setOptions: (options: SplashScreenOptions) => void;\n preventAutoHideAsync: () => Promise<boolean>;\n hide: () => void;\n hideAsync: () => Promise<void>;\n // @private\n _internal_maybeHideAsync: () => Promise<void>;\n // @private\n _internal_preventAutoHideAsync: () => Promise<boolean>;\n}\n"]}
@@ -1,23 +1,6 @@
1
1
  import { SplashScreenOptions } from './SplashScreen.types';
2
- /**
3
- * Expo Router uses this internal method to ensure that we can detect if the user
4
- * has explicitly opted into preventing the splash screen from hiding. This means
5
- * they will also explicitly hide it. If they don't, we will hide it for them after
6
- * the navigation render completes.
7
- *
8
- * @private
9
- */
10
- export declare function _internal_preventAutoHideAsync(): Promise<boolean>;
11
- /**
12
- * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
13
- * If the user has explicitly opted into preventing the splash screen from hiding, we should not
14
- * hide it for them. This is often used for animated splash screens.
15
- *
16
- * @private
17
- */
18
- export declare const _internal_maybeHideAsync: () => void;
19
2
  export declare function setOptions(options: SplashScreenOptions): void;
20
3
  export declare function hide(): void;
21
4
  export declare function hideAsync(): Promise<void>;
22
- export declare const preventAutoHideAsync: () => Promise<boolean>;
5
+ export declare function preventAutoHideAsync(): Promise<boolean | undefined>;
23
6
  //# sourceMappingURL=index.native.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAOrF;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,IAAI,OAAO,CAAC,OAAO,CAAC,CAsBvE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,YAOpC,CAAC;AAEF,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,QAMtD;AAED,wBAAgB,IAAI,SAMnB;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,eAAO,MAAM,oBAAoB,wBAKhC,CAAC"}
1
+ {"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAEA,OAAO,EAA4B,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAIrF,wBAAgB,UAAU,CAAC,OAAO,EAAE,mBAAmB,QAMtD;AAED,wBAAgB,IAAI,SAMnB;AAED,wBAAsB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED,wBAAsB,oBAAoB,iCAMzC"}
@@ -1,50 +1,5 @@
1
1
  import { requireOptionalNativeModule } from 'expo-modules-core';
2
2
  const SplashModule = requireOptionalNativeModule('ExpoSplashScreen');
3
- let _userControlledAutoHideEnabled = false;
4
- let _preventAutoHideAsyncInvoked = false;
5
- /**
6
- * Expo Router uses this internal method to ensure that we can detect if the user
7
- * has explicitly opted into preventing the splash screen from hiding. This means
8
- * they will also explicitly hide it. If they don't, we will hide it for them after
9
- * the navigation render completes.
10
- *
11
- * @private
12
- */
13
- export async function _internal_preventAutoHideAsync() {
14
- if (!SplashModule) {
15
- return false;
16
- }
17
- // Memoize, this should only be called once.
18
- if (_preventAutoHideAsyncInvoked) {
19
- return false;
20
- }
21
- _preventAutoHideAsyncInvoked = true;
22
- // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
23
- // This prevents the splash screen from floating over error screens.
24
- if (ErrorUtils?.getGlobalHandler) {
25
- const originalHandler = ErrorUtils.getGlobalHandler();
26
- ErrorUtils.setGlobalHandler((error, isFatal) => {
27
- hide();
28
- originalHandler(error, isFatal);
29
- });
30
- }
31
- return SplashModule.preventAutoHideAsync();
32
- }
33
- /**
34
- * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
35
- * If the user has explicitly opted into preventing the splash screen from hiding, we should not
36
- * hide it for them. This is often used for animated splash screens.
37
- *
38
- * @private
39
- */
40
- export const _internal_maybeHideAsync = () => {
41
- // If the user has explicitly opted into preventing the splash screen from hiding,
42
- // we should not hide it for them. This is often used for animated splash screens.
43
- if (_userControlledAutoHideEnabled) {
44
- return;
45
- }
46
- hide();
47
- };
48
3
  export function setOptions(options) {
49
4
  if (!SplashModule) {
50
5
  return;
@@ -60,10 +15,10 @@ export function hide() {
60
15
  export async function hideAsync() {
61
16
  hide();
62
17
  }
63
- export const preventAutoHideAsync = () => {
64
- // Indicate that the user is controlling the auto hide behavior.
65
- _userControlledAutoHideEnabled = true;
66
- // Prevent as usual...
67
- return _internal_preventAutoHideAsync();
68
- };
18
+ export async function preventAutoHideAsync() {
19
+ if (!SplashModule) {
20
+ return;
21
+ }
22
+ return SplashModule.preventAutoHideAsync();
23
+ }
69
24
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAIhE,MAAM,YAAY,GAAG,2BAA2B,CAA2B,kBAAkB,CAAC,CAAC;AAE/F,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAC3C,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAClD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO,KAAK,CAAC;KACd;IAED,4CAA4C;IAC5C,IAAI,4BAA4B,EAAE;QAChC,OAAO,KAAK,CAAC;KACd;IACD,4BAA4B,GAAG,IAAI,CAAC;IAEpC,oGAAoG;IACpG,oEAAoE;IACpE,IAAI,UAAU,EAAE,gBAAgB,EAAE;QAChC,MAAM,eAAe,GAAG,UAAU,CAAC,gBAAgB,EAAE,CAAC;QACtD,UAAU,CAAC,gBAAgB,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YAC7C,IAAI,EAAE,CAAC;YACP,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,kFAAkF;IAClF,kFAAkF;IAClF,IAAI,8BAA8B,EAAE;QAClC,OAAO;KACR;IACD,IAAI,EAAE,CAAC;AACT,CAAC,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,OAA4B;IACrD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,EAAE,CAAC;AACT,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,gEAAgE;IAChE,8BAA8B,GAAG,IAAI,CAAC;IACtC,sBAAsB;IACtB,OAAO,8BAA8B,EAAE,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["import { requireOptionalNativeModule } from 'expo-modules-core';\n\nimport { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.types';\n\nconst SplashModule = requireOptionalNativeModule<SplashScreenNativeModule>('ExpoSplashScreen');\n\nlet _userControlledAutoHideEnabled = false;\nlet _preventAutoHideAsyncInvoked = false;\n\n/**\n * Expo Router uses this internal method to ensure that we can detect if the user\n * has explicitly opted into preventing the splash screen from hiding. This means\n * they will also explicitly hide it. If they don't, we will hide it for them after\n * the navigation render completes.\n *\n * @private\n */\nexport async function _internal_preventAutoHideAsync(): Promise<boolean> {\n if (!SplashModule) {\n return false;\n }\n\n // Memoize, this should only be called once.\n if (_preventAutoHideAsyncInvoked) {\n return false;\n }\n _preventAutoHideAsyncInvoked = true;\n\n // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.\n // This prevents the splash screen from floating over error screens.\n if (ErrorUtils?.getGlobalHandler) {\n const originalHandler = ErrorUtils.getGlobalHandler();\n ErrorUtils.setGlobalHandler((error, isFatal) => {\n hide();\n originalHandler(error, isFatal);\n });\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n\n/**\n * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.\n * If the user has explicitly opted into preventing the splash screen from hiding, we should not\n * hide it for them. This is often used for animated splash screens.\n *\n * @private\n */\nexport const _internal_maybeHideAsync = () => {\n // If the user has explicitly opted into preventing the splash screen from hiding,\n // we should not hide it for them. This is often used for animated splash screens.\n if (_userControlledAutoHideEnabled) {\n return;\n }\n hide();\n};\n\nexport function setOptions(options: SplashScreenOptions) {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.setOptions(options);\n}\n\nexport function hide() {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.hide();\n}\n\nexport async function hideAsync(): Promise<void> {\n hide();\n}\n\nexport const preventAutoHideAsync = () => {\n // Indicate that the user is controlling the auto hide behavior.\n _userControlledAutoHideEnabled = true;\n // Prevent as usual...\n return _internal_preventAutoHideAsync();\n};\n"]}
1
+ {"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAIhE,MAAM,YAAY,GAAG,2BAA2B,CAA2B,kBAAkB,CAAC,CAAC;AAE/F,MAAM,UAAU,UAAU,CAAC,OAA4B;IACrD,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,IAAI;IAClB,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,YAAY,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,EAAE,CAAC;AACT,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,YAAY,EAAE;QACjB,OAAO;KACR;IAED,OAAO,YAAY,CAAC,oBAAoB,EAAE,CAAC;AAC7C,CAAC","sourcesContent":["import { requireOptionalNativeModule } from 'expo-modules-core';\n\nimport { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.types';\n\nconst SplashModule = requireOptionalNativeModule<SplashScreenNativeModule>('ExpoSplashScreen');\n\nexport function setOptions(options: SplashScreenOptions) {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.setOptions(options);\n}\n\nexport function hide() {\n if (!SplashModule) {\n return;\n }\n\n SplashModule.hide();\n}\n\nexport async function hideAsync(): Promise<void> {\n hide();\n}\n\nexport async function preventAutoHideAsync() {\n if (!SplashModule) {\n return;\n }\n\n return SplashModule.preventAutoHideAsync();\n}\n"]}
@@ -1,13 +1,11 @@
1
1
  import ExpoModulesCore
2
2
 
3
3
  public class SplashScreenModule: Module {
4
+ var userControlledAutoHideEnabled = false
5
+
4
6
  public func definition() -> ModuleDefinition {
5
7
  Name("ExpoSplashScreen")
6
8
 
7
- AsyncFunction("preventAutoHideAsync") {
8
- SplashScreenManager.shared.preventAutoHideCalled = true
9
- }
10
-
11
9
  Function("setOptions") { (options: SplashScreenOptions) in
12
10
  SplashScreenManager.shared.setOptions(options: options)
13
11
  }
@@ -20,6 +18,24 @@ public class SplashScreenModule: Module {
20
18
  SplashScreenManager.shared.hide()
21
19
  }
22
20
 
21
+ AsyncFunction("internalMaybeHideAsync") {
22
+ if !userControlledAutoHideEnabled {
23
+ SplashScreenManager.shared.hide()
24
+ }
25
+ }
26
+
27
+ AsyncFunction("preventAutoHideAsync") {
28
+ // The user has manually invoked prevent autohide, this is used to allow libraries
29
+ // such as expo-router to know whether it's safe to hide or if they should wait for
30
+ // the user to do it.
31
+ userControlledAutoHideEnabled = true
32
+ SplashScreenManager.shared.preventAutoHideCalled = true
33
+ }
34
+
35
+ AsyncFunction("internalPreventAutoHideAsync") {
36
+ SplashScreenManager.shared.preventAutoHideCalled = true
37
+ }
38
+
23
39
  OnDestroy {
24
40
  SplashScreenManager.shared.removeObservers()
25
41
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-splash-screen",
3
- "version": "0.29.1",
3
+ "version": "0.29.3",
4
4
  "description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
5
5
  "main": "build",
6
6
  "types": "build",
@@ -34,7 +34,7 @@
34
34
  "license": "MIT",
35
35
  "homepage": "https://docs.expo.dev/versions/latest/sdk/splash-screen/",
36
36
  "dependencies": {
37
- "@expo/prebuild-config": "8.0.7"
37
+ "@expo/prebuild-config": "8.0.9"
38
38
  },
39
39
  "devDependencies": {
40
40
  "expo-module-scripts": "^4.0.0"
@@ -42,5 +42,5 @@
42
42
  "peerDependencies": {
43
43
  "expo": "*"
44
44
  },
45
- "gitHead": "bcb207e3106cbb6568e419296f43e03703d6f0bc"
45
+ "gitHead": "d7775d436fab9d9601c193dfe2cc65a2949ef2ed"
46
46
  }
@@ -19,4 +19,8 @@ export interface SplashScreenNativeModule extends NativeModule {
19
19
  preventAutoHideAsync: () => Promise<boolean>;
20
20
  hide: () => void;
21
21
  hideAsync: () => Promise<void>;
22
+ // @private
23
+ _internal_maybeHideAsync: () => Promise<void>;
24
+ // @private
25
+ _internal_preventAutoHideAsync: () => Promise<boolean>;
22
26
  }
@@ -4,57 +4,6 @@ import { SplashScreenNativeModule, SplashScreenOptions } from './SplashScreen.ty
4
4
 
5
5
  const SplashModule = requireOptionalNativeModule<SplashScreenNativeModule>('ExpoSplashScreen');
6
6
 
7
- let _userControlledAutoHideEnabled = false;
8
- let _preventAutoHideAsyncInvoked = false;
9
-
10
- /**
11
- * Expo Router uses this internal method to ensure that we can detect if the user
12
- * has explicitly opted into preventing the splash screen from hiding. This means
13
- * they will also explicitly hide it. If they don't, we will hide it for them after
14
- * the navigation render completes.
15
- *
16
- * @private
17
- */
18
- export async function _internal_preventAutoHideAsync(): Promise<boolean> {
19
- if (!SplashModule) {
20
- return false;
21
- }
22
-
23
- // Memoize, this should only be called once.
24
- if (_preventAutoHideAsyncInvoked) {
25
- return false;
26
- }
27
- _preventAutoHideAsyncInvoked = true;
28
-
29
- // Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
30
- // This prevents the splash screen from floating over error screens.
31
- if (ErrorUtils?.getGlobalHandler) {
32
- const originalHandler = ErrorUtils.getGlobalHandler();
33
- ErrorUtils.setGlobalHandler((error, isFatal) => {
34
- hide();
35
- originalHandler(error, isFatal);
36
- });
37
- }
38
-
39
- return SplashModule.preventAutoHideAsync();
40
- }
41
-
42
- /**
43
- * Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
44
- * If the user has explicitly opted into preventing the splash screen from hiding, we should not
45
- * hide it for them. This is often used for animated splash screens.
46
- *
47
- * @private
48
- */
49
- export const _internal_maybeHideAsync = () => {
50
- // If the user has explicitly opted into preventing the splash screen from hiding,
51
- // we should not hide it for them. This is often used for animated splash screens.
52
- if (_userControlledAutoHideEnabled) {
53
- return;
54
- }
55
- hide();
56
- };
57
-
58
7
  export function setOptions(options: SplashScreenOptions) {
59
8
  if (!SplashModule) {
60
9
  return;
@@ -75,9 +24,10 @@ export async function hideAsync(): Promise<void> {
75
24
  hide();
76
25
  }
77
26
 
78
- export const preventAutoHideAsync = () => {
79
- // Indicate that the user is controlling the auto hide behavior.
80
- _userControlledAutoHideEnabled = true;
81
- // Prevent as usual...
82
- return _internal_preventAutoHideAsync();
83
- };
27
+ export async function preventAutoHideAsync() {
28
+ if (!SplashModule) {
29
+ return;
30
+ }
31
+
32
+ return SplashModule.preventAutoHideAsync();
33
+ }