expo-splash-screen 0.24.0 → 0.26.0
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 +21 -0
- package/android/build.gradle +4 -6
- package/android/src/main/java/expo/modules/splashscreen/NativeResourcesBasedSplashScreenViewProvider.kt +1 -1
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenModule.kt +18 -17
- package/android/src/main/java/expo/modules/splashscreen/SplashScreenReactActivityLifecycleListener.kt +1 -1
- package/build/index.native.d.ts +19 -1
- package/build/index.native.d.ts.map +1 -1
- package/build/index.native.js +61 -1
- package/build/index.native.js.map +1 -1
- package/ios/EXSplashScreen.podspec +1 -1
- package/package.json +3 -3
- package/src/index.native.ts +69 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,27 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.26.0 — 2023-12-12
|
|
14
|
+
|
|
15
|
+
### 💡 Others
|
|
16
|
+
|
|
17
|
+
- Removed 'The current activity is no longer available' warning on Android. ([#25608](https://github.com/expo/expo/pull/25608) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
18
|
+
|
|
19
|
+
## 0.25.0 — 2023-11-14
|
|
20
|
+
|
|
21
|
+
### 🛠 Breaking changes
|
|
22
|
+
|
|
23
|
+
- Bumped iOS deployment target to 13.4. ([#25063](https://github.com/expo/expo/pull/25063) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
24
|
+
- On `Android` bump `compileSdkVersion` and `targetSdkVersion` to `34`. ([#24708](https://github.com/expo/expo/pull/24708) by [@alanjhughes](https://github.com/alanjhughes))
|
|
25
|
+
|
|
26
|
+
### 🎉 New features
|
|
27
|
+
|
|
28
|
+
- Automatically dismiss splash screen when an error is thrown to prevent blocking error information. ([#24893](https://github.com/expo/expo/pull/24893) by [@EvanBacon](https://github.com/EvanBacon))
|
|
29
|
+
|
|
30
|
+
### 💡 Others
|
|
31
|
+
|
|
32
|
+
- Moved changes required for splash screen orchestration from `expo-router` to `expo-splash-screen`. ([#24893](https://github.com/expo/expo/pull/24893) by [@EvanBacon](https://github.com/EvanBacon))
|
|
33
|
+
|
|
13
34
|
## 0.24.0 — 2023-10-17
|
|
14
35
|
|
|
15
36
|
### 🛠 Breaking changes
|
package/android/build.gradle
CHANGED
|
@@ -3,7 +3,7 @@ apply plugin: 'kotlin-android'
|
|
|
3
3
|
apply plugin: 'maven-publish'
|
|
4
4
|
|
|
5
5
|
group = 'host.exp.exponent'
|
|
6
|
-
version = '0.
|
|
6
|
+
version = '0.26.0'
|
|
7
7
|
|
|
8
8
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
9
9
|
if (expoModulesCorePlugin.exists()) {
|
|
@@ -61,11 +61,11 @@ if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
|
61
61
|
android {
|
|
62
62
|
// Remove this if and it's contents, when support for SDK49 is dropped
|
|
63
63
|
if (!safeExtGet("expoProvidesDefaultConfig", false)) {
|
|
64
|
-
compileSdkVersion safeExtGet("compileSdkVersion",
|
|
64
|
+
compileSdkVersion safeExtGet("compileSdkVersion", 34)
|
|
65
65
|
|
|
66
66
|
defaultConfig {
|
|
67
67
|
minSdkVersion safeExtGet("minSdkVersion", 23)
|
|
68
|
-
targetSdkVersion safeExtGet("targetSdkVersion",
|
|
68
|
+
targetSdkVersion safeExtGet("targetSdkVersion", 34)
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
publishing {
|
|
@@ -93,10 +93,8 @@ android {
|
|
|
93
93
|
|
|
94
94
|
namespace "expo.modules.splashscreen"
|
|
95
95
|
defaultConfig {
|
|
96
|
-
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
97
|
-
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
98
96
|
versionCode 17
|
|
99
|
-
versionName '0.
|
|
97
|
+
versionName '0.26.0'
|
|
100
98
|
}
|
|
101
99
|
}
|
|
102
100
|
|
|
@@ -7,7 +7,7 @@ import androidx.core.content.ContextCompat
|
|
|
7
7
|
/* ktlint-disable no-unused-imports */
|
|
8
8
|
import expo.modules.splashscreen.SplashScreenImageResizeMode
|
|
9
9
|
import expo.modules.splashscreen.SplashScreenViewProvider
|
|
10
|
-
//
|
|
10
|
+
// EXPO_VERSIONING_NEEDS_PACKAGE_R
|
|
11
11
|
/* ktlint-enable no-unused-imports */
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package expo.modules.splashscreen
|
|
2
2
|
|
|
3
3
|
import expo.modules.kotlin.Promise
|
|
4
|
-
import expo.modules.kotlin.exception.Exceptions
|
|
5
4
|
import expo.modules.kotlin.modules.Module
|
|
6
5
|
import expo.modules.kotlin.modules.ModuleDefinition
|
|
7
6
|
import expo.modules.splashscreen.exceptions.HideAsyncException
|
|
@@ -18,25 +17,27 @@ class SplashScreenModule : Module() {
|
|
|
18
17
|
Name("ExpoSplashScreen")
|
|
19
18
|
|
|
20
19
|
AsyncFunction("preventAutoHideAsync") { promise: Promise ->
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
appContext.currentActivity?.let {
|
|
21
|
+
SplashScreen.preventAutoHide(
|
|
22
|
+
it,
|
|
23
|
+
{ hasEffect -> promise.resolve(hasEffect) },
|
|
24
|
+
{ m -> promise.reject(PreventAutoHideException(m)) }
|
|
25
|
+
)
|
|
26
|
+
} ?: run {
|
|
27
|
+
promise.resolve(false)
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
AsyncFunction("hideAsync") { promise: Promise ->
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
appContext.currentActivity?.let {
|
|
33
|
+
SplashScreen.hide(
|
|
34
|
+
it,
|
|
35
|
+
{ hasEffect -> promise.resolve(hasEffect) },
|
|
36
|
+
{ m -> promise.reject(HideAsyncException(m)) }
|
|
37
|
+
)
|
|
38
|
+
} ?: run {
|
|
39
|
+
promise.resolve(false)
|
|
40
|
+
}
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -9,7 +9,7 @@ import expo.modules.splashscreen.singletons.SplashScreen
|
|
|
9
9
|
// this needs to stay for versioning to work
|
|
10
10
|
/* ktlint-disable no-unused-imports */
|
|
11
11
|
import expo.modules.splashscreen.SplashScreenImageResizeMode
|
|
12
|
-
//
|
|
12
|
+
// EXPO_VERSIONING_NEEDS_PACKAGE_R
|
|
13
13
|
/* ktlint-enable no-unused-imports */
|
|
14
14
|
|
|
15
15
|
class SplashScreenReactActivityLifecycleListener(activityContext: Context) : ReactActivityLifecycleListener {
|
package/build/index.native.d.ts
CHANGED
|
@@ -1,2 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Expo Router uses this internal method to ensure that we can detect if the user
|
|
3
|
+
* has explicitly opted into preventing the splash screen from hiding. This means
|
|
4
|
+
* they will also explicitly hide it. If they don't, we will hide it for them after
|
|
5
|
+
* the navigation render completes.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
9
|
+
export declare const _internal_preventAutoHideAsync: () => void;
|
|
10
|
+
/**
|
|
11
|
+
* Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
|
|
12
|
+
* If the user has explicitly opted into preventing the splash screen from hiding, we should not
|
|
13
|
+
* hide it for them. This is often used for animated splash screens.
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
export declare const _internal_maybeHideAsync: () => void;
|
|
18
|
+
export declare function hideAsync(): Promise<boolean | void>;
|
|
19
|
+
export declare const preventAutoHideAsync: () => void;
|
|
2
20
|
//# sourceMappingURL=index.native.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAUA;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B,YAkB1C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,YAOpC,CAAC;AAEF,wBAAgB,SAAS,4BAYxB;AAED,eAAO,MAAM,oBAAoB,YAKhC,CAAC"}
|
package/build/index.native.js
CHANGED
|
@@ -1,3 +1,63 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo-modules-core';
|
|
2
|
-
|
|
2
|
+
const SplashModule = requireNativeModule('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 const _internal_preventAutoHideAsync = () => {
|
|
14
|
+
// Memoize, this should only be called once.
|
|
15
|
+
if (_preventAutoHideAsyncInvoked) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
_preventAutoHideAsyncInvoked = true;
|
|
19
|
+
// Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
|
|
20
|
+
// This prevents the splash screen from floating over error screens.
|
|
21
|
+
if (ErrorUtils?.getGlobalHandler) {
|
|
22
|
+
const originalHandler = ErrorUtils.getGlobalHandler();
|
|
23
|
+
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
24
|
+
hideAsync();
|
|
25
|
+
originalHandler(error, isFatal);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
SplashModule.preventAutoHideAsync();
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
|
|
32
|
+
* If the user has explicitly opted into preventing the splash screen from hiding, we should not
|
|
33
|
+
* hide it for them. This is often used for animated splash screens.
|
|
34
|
+
*
|
|
35
|
+
* @private
|
|
36
|
+
*/
|
|
37
|
+
export const _internal_maybeHideAsync = () => {
|
|
38
|
+
// If the user has explicitly opted into preventing the splash screen from hiding,
|
|
39
|
+
// we should not hide it for them. This is often used for animated splash screens.
|
|
40
|
+
if (_userControlledAutoHideEnabled) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
hideAsync();
|
|
44
|
+
};
|
|
45
|
+
export function hideAsync() {
|
|
46
|
+
return SplashModule.hideAsync().catch((error) => {
|
|
47
|
+
// Hide this very unfortunate error.
|
|
48
|
+
if (
|
|
49
|
+
// Only throw the error is something unexpected happened.
|
|
50
|
+
_preventAutoHideAsyncInvoked &&
|
|
51
|
+
error.message.includes('No native splash screen registered for ')) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export const preventAutoHideAsync = () => {
|
|
58
|
+
// Indicate that the user is controlling the auto hide behavior.
|
|
59
|
+
_userControlledAutoHideEnabled = true;
|
|
60
|
+
// Prevent as usual...
|
|
61
|
+
_internal_preventAutoHideAsync();
|
|
62
|
+
};
|
|
3
63
|
//# 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,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"index.native.js","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,MAAM,YAAY,GAAG,mBAAmB,CAAC,kBAAkB,CAG1D,CAAC;AAEF,IAAI,8BAA8B,GAAG,KAAK,CAAC;AAC3C,IAAI,4BAA4B,GAAG,KAAK,CAAC;AAEzC;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,EAAE;IACjD,4CAA4C;IAC5C,IAAI,4BAA4B,EAAE;QAChC,OAAO;KACR;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,SAAS,EAAE,CAAC;YACZ,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;KACJ;IAED,YAAY,CAAC,oBAAoB,EAAE,CAAC;AACtC,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,EAAE;IAC3C,kFAAkF;IAClF,kFAAkF;IAClF,IAAI,8BAA8B,EAAE;QAClC,OAAO;KACR;IACD,SAAS,EAAE,CAAC;AACd,CAAC,CAAC;AAEF,MAAM,UAAU,SAAS;IACvB,OAAO,YAAY,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,KAAU,EAAE,EAAE;QACnD,oCAAoC;QACpC;QACE,yDAAyD;QACzD,4BAA4B;YAC5B,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,yCAAyC,CAAC,EACjE;YACA,OAAO;SACR;QACD,MAAM,KAAK,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,gEAAgE;IAChE,8BAA8B,GAAG,IAAI,CAAC;IACtC,sBAAsB;IACtB,8BAA8B,EAAE,CAAC;AACnC,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nconst SplashModule = requireNativeModule('ExpoSplashScreen') as {\n preventAutoHideAsync: () => Promise<boolean>;\n hideAsync: () => Promise<boolean>;\n};\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 const _internal_preventAutoHideAsync = () => {\n // Memoize, this should only be called once.\n if (_preventAutoHideAsyncInvoked) {\n return;\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 hideAsync();\n originalHandler(error, isFatal);\n });\n }\n\n 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 hideAsync();\n};\n\nexport function hideAsync() {\n return SplashModule.hideAsync().catch((error: any) => {\n // Hide this very unfortunate error.\n if (\n // Only throw the error is something unexpected happened.\n _preventAutoHideAsyncInvoked &&\n error.message.includes('No native splash screen registered for ')\n ) {\n return;\n }\n throw error;\n });\n}\n\nexport const preventAutoHideAsync = () => {\n // Indicate that the user is controlling the auto hide behavior.\n _userControlledAutoHideEnabled = true;\n // Prevent as usual...\n _internal_preventAutoHideAsync();\n};\n"]}
|
|
@@ -10,7 +10,7 @@ Pod::Spec.new do |s|
|
|
|
10
10
|
s.license = package['license']
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.homepage = package['homepage']
|
|
13
|
-
s.platforms = { :ios => '13.
|
|
13
|
+
s.platforms = { :ios => '13.4', :tvos => '13.4' }
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-splash-screen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
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": "6.
|
|
37
|
+
"@expo/prebuild-config": "6.7.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"expo-module-scripts": "^3.0.0"
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"expo": "*"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "6aca7ce098ddc667776a3d7cf612adbb985e264a"
|
|
46
46
|
}
|
package/src/index.native.ts
CHANGED
|
@@ -1,6 +1,74 @@
|
|
|
1
1
|
import { requireNativeModule } from 'expo-modules-core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const SplashModule = requireNativeModule('ExpoSplashScreen') as {
|
|
4
4
|
preventAutoHideAsync: () => Promise<boolean>;
|
|
5
5
|
hideAsync: () => Promise<boolean>;
|
|
6
6
|
};
|
|
7
|
+
|
|
8
|
+
let _userControlledAutoHideEnabled = false;
|
|
9
|
+
let _preventAutoHideAsyncInvoked = false;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Expo Router uses this internal method to ensure that we can detect if the user
|
|
13
|
+
* has explicitly opted into preventing the splash screen from hiding. This means
|
|
14
|
+
* they will also explicitly hide it. If they don't, we will hide it for them after
|
|
15
|
+
* the navigation render completes.
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
*/
|
|
19
|
+
export const _internal_preventAutoHideAsync = () => {
|
|
20
|
+
// Memoize, this should only be called once.
|
|
21
|
+
if (_preventAutoHideAsyncInvoked) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
_preventAutoHideAsyncInvoked = true;
|
|
25
|
+
|
|
26
|
+
// Append error handling to ensure any uncaught exceptions result in the splash screen being hidden.
|
|
27
|
+
// This prevents the splash screen from floating over error screens.
|
|
28
|
+
if (ErrorUtils?.getGlobalHandler) {
|
|
29
|
+
const originalHandler = ErrorUtils.getGlobalHandler();
|
|
30
|
+
ErrorUtils.setGlobalHandler((error, isFatal) => {
|
|
31
|
+
hideAsync();
|
|
32
|
+
originalHandler(error, isFatal);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
SplashModule.preventAutoHideAsync();
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Used for Expo libraries to attempt hiding the splash screen after they've completed their work.
|
|
41
|
+
* If the user has explicitly opted into preventing the splash screen from hiding, we should not
|
|
42
|
+
* hide it for them. This is often used for animated splash screens.
|
|
43
|
+
*
|
|
44
|
+
* @private
|
|
45
|
+
*/
|
|
46
|
+
export const _internal_maybeHideAsync = () => {
|
|
47
|
+
// If the user has explicitly opted into preventing the splash screen from hiding,
|
|
48
|
+
// we should not hide it for them. This is often used for animated splash screens.
|
|
49
|
+
if (_userControlledAutoHideEnabled) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
hideAsync();
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export function hideAsync() {
|
|
56
|
+
return SplashModule.hideAsync().catch((error: any) => {
|
|
57
|
+
// Hide this very unfortunate error.
|
|
58
|
+
if (
|
|
59
|
+
// Only throw the error is something unexpected happened.
|
|
60
|
+
_preventAutoHideAsyncInvoked &&
|
|
61
|
+
error.message.includes('No native splash screen registered for ')
|
|
62
|
+
) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
throw error;
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export const preventAutoHideAsync = () => {
|
|
70
|
+
// Indicate that the user is controlling the auto hide behavior.
|
|
71
|
+
_userControlledAutoHideEnabled = true;
|
|
72
|
+
// Prevent as usual...
|
|
73
|
+
_internal_preventAutoHideAsync();
|
|
74
|
+
};
|