expo-splash-screen 0.21.1 → 0.23.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 +20 -0
- package/android/build.gradle +11 -8
- package/build/index.d.ts +25 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +31 -1
- package/build/index.js.map +1 -1
- package/build/index.native.d.ts +2 -0
- package/build/index.native.d.ts.map +1 -0
- package/build/index.native.js +3 -0
- package/build/index.native.js.map +1 -0
- package/ios/EXSplashScreen/EXSplashScreenService.m +0 -6
- package/ios/EXSplashScreen.podspec +1 -1
- package/package.json +5 -8
- package/src/index.native.ts +6 -0
- package/src/index.ts +32 -1
- package/build/ExpoSplashScreen.d.ts +0 -3
- package/build/ExpoSplashScreen.d.ts.map +0 -1
- package/build/ExpoSplashScreen.js +0 -3
- package/build/ExpoSplashScreen.js.map +0 -1
- package/build/ExpoSplashScreen.web.d.ts +0 -7
- package/build/ExpoSplashScreen.web.d.ts.map +0 -1
- package/build/ExpoSplashScreen.web.js +0 -12
- package/build/ExpoSplashScreen.web.js.map +0 -1
- package/build/SplashScreen.d.ts +0 -36
- package/build/SplashScreen.d.ts.map +0 -1
- package/build/SplashScreen.js +0 -56
- package/build/SplashScreen.js.map +0 -1
- package/src/ExpoSplashScreen.ts +0 -2
- package/src/ExpoSplashScreen.web.ts +0 -11
- package/src/SplashScreen.ts +0 -62
- package/src/__mocks__/ExpoSplashScreen.ts +0 -4
- package/src/__mocks__/ExpoSplashScreen.web.ts +0 -4
- package/src/__tests__/SplashScreen-test.ts +0 -17
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,26 @@
|
|
|
10
10
|
|
|
11
11
|
### 💡 Others
|
|
12
12
|
|
|
13
|
+
## 0.23.0 — 2023-09-15
|
|
14
|
+
|
|
15
|
+
### 🎉 New features
|
|
16
|
+
|
|
17
|
+
- Added support for Apple tvOS. ([#24329](https://github.com/expo/expo/pull/24329) by [@douglowder](https://github.com/douglowder))
|
|
18
|
+
|
|
19
|
+
### 💡 Others
|
|
20
|
+
|
|
21
|
+
- Delete deprecated `hide` and `preventAutoHide` methods. ([#24296](https://github.com/expo/expo/pull/24296) by [@EvanBacon](https://github.com/EvanBacon))
|
|
22
|
+
|
|
23
|
+
## 0.22.0 — 2023-09-04
|
|
24
|
+
|
|
25
|
+
### 🎉 New features
|
|
26
|
+
|
|
27
|
+
- Added support for React Native 0.73. ([#24018](https://github.com/expo/expo/pull/24018) by [@kudo](https://github.com/kudo))
|
|
28
|
+
|
|
29
|
+
### 💡 Others
|
|
30
|
+
|
|
31
|
+
- Removed 'No native splash screen registered' warning on iOS when opening and reloading the app. ([#24210](https://github.com/expo/expo/pull/24210) by [@gabrieldonadel](https://github.com/gabrieldonadel))
|
|
32
|
+
|
|
13
33
|
## 0.21.1 — 2023-08-02
|
|
14
34
|
|
|
15
35
|
_This version does not introduce any user-facing 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.23.0'
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
9
9
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
@@ -53,13 +53,16 @@ afterEvaluate {
|
|
|
53
53
|
android {
|
|
54
54
|
compileSdkVersion safeExtGet("compileSdkVersion", 33)
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
|
|
57
|
+
if (agpVersion.tokenize('.')[0].toInteger() < 8) {
|
|
58
|
+
compileOptions {
|
|
59
|
+
sourceCompatibility JavaVersion.VERSION_11
|
|
60
|
+
targetCompatibility JavaVersion.VERSION_11
|
|
61
|
+
}
|
|
60
62
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
kotlinOptions {
|
|
64
|
+
jvmTarget = JavaVersion.VERSION_11.majorVersion
|
|
65
|
+
}
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
namespace "expo.modules.splashscreen"
|
|
@@ -67,7 +70,7 @@ android {
|
|
|
67
70
|
minSdkVersion safeExtGet('minSdkVersion', 21)
|
|
68
71
|
targetSdkVersion safeExtGet("targetSdkVersion", 33)
|
|
69
72
|
versionCode 17
|
|
70
|
-
versionName '0.
|
|
73
|
+
versionName '0.23.0'
|
|
71
74
|
}
|
|
72
75
|
lintOptions {
|
|
73
76
|
abortOnError false
|
package/build/index.d.ts
CHANGED
|
@@ -1,2 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
3
|
+
*
|
|
4
|
+
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
5
|
+
* > inside React components or hooks, because otherwise this might be called too late,
|
|
6
|
+
* > when the splash screen is already hidden.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import * as SplashScreen from 'expo-splash-screen';
|
|
11
|
+
*
|
|
12
|
+
* SplashScreen.preventAutoHideAsync();
|
|
13
|
+
*
|
|
14
|
+
* export default function App() {
|
|
15
|
+
* // ...
|
|
16
|
+
* }
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function preventAutoHideAsync(): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
22
|
+
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
23
|
+
* ["Usage"](#usage) section for an example.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hideAsync(): Promise<boolean>;
|
|
2
26
|
//# sourceMappingURL=index.d.ts.map
|
package/build/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE7D;AAGD;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAElD"}
|
package/build/index.js
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
// @needsAudit
|
|
2
|
+
/**
|
|
3
|
+
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
4
|
+
*
|
|
5
|
+
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
6
|
+
* > inside React components or hooks, because otherwise this might be called too late,
|
|
7
|
+
* > when the splash screen is already hidden.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import * as SplashScreen from 'expo-splash-screen';
|
|
12
|
+
*
|
|
13
|
+
* SplashScreen.preventAutoHideAsync();
|
|
14
|
+
*
|
|
15
|
+
* export default function App() {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export async function preventAutoHideAsync() {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
// @needsAudit
|
|
24
|
+
/**
|
|
25
|
+
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
26
|
+
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
27
|
+
* ["Usage"](#usage) section for an example.
|
|
28
|
+
*/
|
|
29
|
+
export async function hideAsync() {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
2
32
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc;AACd;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["// @needsAudit\n/**\n * Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.\n *\n * > **Important note**: It is recommended to call this in global scope without awaiting, rather than\n * > inside React components or hooks, because otherwise this might be called too late,\n * > when the splash screen is already hidden.\n *\n * @example\n * ```ts\n * import * as SplashScreen from 'expo-splash-screen';\n *\n * SplashScreen.preventAutoHideAsync();\n *\n * export default function App() {\n * // ...\n * }\n * ```\n */\nexport async function preventAutoHideAsync(): Promise<boolean> {\n return false;\n}\n\n// @needsAudit\n/**\n * Hides the native splash screen immediately. Be careful to ensure that your app has content ready\n * to display when you hide the splash screen, or you may see a blank screen briefly. See the\n * [\"Usage\"](#usage) section for an example.\n */\nexport async function hideAsync(): Promise<boolean> {\n return false;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.native.d.ts","sourceRoot":"","sources":["../src/index.native.ts"],"names":[],"mappings":"AAEA,eAAO,MAAQ,oBAAoB,QACL,QAAQ,OAAO,CAAC,EADT,SAAS,QAE3B,QAAQ,OAAO,CACjC,CAAC"}
|
|
@@ -0,0 +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,mBAAmB,CAAC,kBAAkB,CAGxF,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\n\nexport const { preventAutoHideAsync, hideAsync } = requireNativeModule('ExpoSplashScreen') as {\n preventAutoHideAsync: () => Promise<boolean>;\n hideAsync: () => Promise<boolean>;\n};\n"]}
|
|
@@ -114,9 +114,6 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
|
|
|
114
114
|
|
|
115
115
|
- (void)onAppContentDidAppear:(UIViewController *)viewController
|
|
116
116
|
{
|
|
117
|
-
if ([self isAppActive] && ![self.splashScreenControllers objectForKey:viewController]) {
|
|
118
|
-
EXLogWarn(@"No native splash screen registered for given view controller. Call 'SplashScreen.show' for given view controller first.");
|
|
119
|
-
}
|
|
120
117
|
BOOL needsHide = [[self.splashScreenControllers objectForKey:viewController] needsHideOnAppContentDidAppear];
|
|
121
118
|
if (needsHide) {
|
|
122
119
|
[self hideSplashScreenFor:viewController
|
|
@@ -128,9 +125,6 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
|
|
|
128
125
|
|
|
129
126
|
- (void)onAppContentWillReload:(UIViewController *)viewController
|
|
130
127
|
{
|
|
131
|
-
if ([self isAppActive] && ![self.splashScreenControllers objectForKey:viewController]) {
|
|
132
|
-
EXLogWarn(@"No native splash screen registered for given view controller. Call 'SplashScreen.show' for given view controller first.");
|
|
133
|
-
}
|
|
134
128
|
BOOL needsShow = [[self.splashScreenControllers objectForKey:viewController] needsShowOnAppContentWillReload];
|
|
135
129
|
if (needsShow) {
|
|
136
130
|
// For reloading apps, specify `EXSplashScreenForceShow` to show splash screen again
|
|
@@ -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.
|
|
13
|
+
s.platforms = { :ios => '13.0', :tvos => '13.0' }
|
|
14
14
|
s.source = { git: 'https://github.com/expo/expo.git' }
|
|
15
15
|
s.static_framework = true
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-splash-screen",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
|
|
5
|
-
"main": "build
|
|
6
|
-
"types": "build
|
|
5
|
+
"main": "build",
|
|
6
|
+
"types": "build",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "expo-module build",
|
|
9
9
|
"clean": "expo-module clean",
|
|
@@ -33,11 +33,8 @@
|
|
|
33
33
|
"author": "650 Industries, Inc.",
|
|
34
34
|
"license": "MIT",
|
|
35
35
|
"homepage": "https://docs.expo.dev/versions/latest/sdk/splash-screen/",
|
|
36
|
-
"jest": {
|
|
37
|
-
"preset": "expo-module-scripts"
|
|
38
|
-
},
|
|
39
36
|
"dependencies": {
|
|
40
|
-
"@expo/prebuild-config": "6.
|
|
37
|
+
"@expo/prebuild-config": "6.4.0"
|
|
41
38
|
},
|
|
42
39
|
"devDependencies": {
|
|
43
40
|
"expo-module-scripts": "^3.0.0"
|
|
@@ -45,5 +42,5 @@
|
|
|
45
42
|
"peerDependencies": {
|
|
46
43
|
"expo": "*"
|
|
47
44
|
},
|
|
48
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "ee2c866ba3c7fbc35ff2a3e896041cf15d3bd7c5"
|
|
49
46
|
}
|
package/src/index.ts
CHANGED
|
@@ -1 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
// @needsAudit
|
|
2
|
+
/**
|
|
3
|
+
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
4
|
+
*
|
|
5
|
+
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
6
|
+
* > inside React components or hooks, because otherwise this might be called too late,
|
|
7
|
+
* > when the splash screen is already hidden.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* import * as SplashScreen from 'expo-splash-screen';
|
|
12
|
+
*
|
|
13
|
+
* SplashScreen.preventAutoHideAsync();
|
|
14
|
+
*
|
|
15
|
+
* export default function App() {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export async function preventAutoHideAsync(): Promise<boolean> {
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// @needsAudit
|
|
25
|
+
/**
|
|
26
|
+
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
27
|
+
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
28
|
+
* ["Usage"](#usage) section for an example.
|
|
29
|
+
*/
|
|
30
|
+
export async function hideAsync(): Promise<boolean> {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSplashScreen.d.ts","sourceRoot":"","sources":["../src/ExpoSplashScreen.ts"],"names":[],"mappings":";AACA,wBAAuD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSplashScreen.js","sourceRoot":"","sources":["../src/ExpoSplashScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,eAAe,mBAAmB,CAAC,kBAAkB,CAAC,CAAC","sourcesContent":["import { requireNativeModule } from 'expo-modules-core';\nexport default requireNativeModule('ExpoSplashScreen');\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSplashScreen.web.d.ts","sourceRoot":"","sources":["../src/ExpoSplashScreen.web.ts"],"names":[],"mappings":";;;;;AAAA,wBAUE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoSplashScreen.web.js","sourceRoot":"","sources":["../src/ExpoSplashScreen.web.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,IAAI;QACN,OAAO,kBAAkB,CAAC;IAC5B,CAAC;IACD,oBAAoB;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,SAAS;QACP,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC","sourcesContent":["export default {\n get name(): string {\n return 'ExpoSplashScreen';\n },\n preventAutoHideAsync() {\n return false;\n },\n hideAsync() {\n return false;\n },\n};\n"]}
|
package/build/SplashScreen.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
3
|
-
*
|
|
4
|
-
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
5
|
-
* > inside React components or hooks, because otherwise this might be called too late,
|
|
6
|
-
* > when the splash screen is already hidden.
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* import * as SplashScreen from 'expo-splash-screen';
|
|
11
|
-
*
|
|
12
|
-
* SplashScreen.preventAutoHideAsync();
|
|
13
|
-
*
|
|
14
|
-
* export default function App() {
|
|
15
|
-
* // ...
|
|
16
|
-
* }
|
|
17
|
-
* ```
|
|
18
|
-
*/
|
|
19
|
-
export declare function preventAutoHideAsync(): Promise<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
22
|
-
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
23
|
-
* ["Usage"](#usage) section for an example.
|
|
24
|
-
*/
|
|
25
|
-
export declare function hideAsync(): Promise<boolean>;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated Use `SplashScreen.hideAsync()` instead
|
|
28
|
-
* @ignore
|
|
29
|
-
*/
|
|
30
|
-
export declare function hide(): void;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use `SplashScreen.preventAutoHideAsync()` instead
|
|
33
|
-
* @ignore
|
|
34
|
-
*/
|
|
35
|
-
export declare function preventAutoHide(): void;
|
|
36
|
-
//# sourceMappingURL=SplashScreen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SplashScreen.d.ts","sourceRoot":"","sources":["../src/SplashScreen.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,OAAO,CAAC,CAK7D;AAGD;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,OAAO,CAAC,CAKlD;AAED;;;GAGG;AACH,wBAAgB,IAAI,IAAI,IAAI,CAG3B;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,IAAI,CAKtC"}
|
package/build/SplashScreen.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
import ExpoSplashScreen from './ExpoSplashScreen';
|
|
3
|
-
// @needsAudit
|
|
4
|
-
/**
|
|
5
|
-
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
6
|
-
*
|
|
7
|
-
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
8
|
-
* > inside React components or hooks, because otherwise this might be called too late,
|
|
9
|
-
* > when the splash screen is already hidden.
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* import * as SplashScreen from 'expo-splash-screen';
|
|
14
|
-
*
|
|
15
|
-
* SplashScreen.preventAutoHideAsync();
|
|
16
|
-
*
|
|
17
|
-
* export default function App() {
|
|
18
|
-
* // ...
|
|
19
|
-
* }
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export async function preventAutoHideAsync() {
|
|
23
|
-
if (!ExpoSplashScreen.preventAutoHideAsync) {
|
|
24
|
-
throw new UnavailabilityError('expo-splash-screen', 'preventAutoHideAsync');
|
|
25
|
-
}
|
|
26
|
-
return await ExpoSplashScreen.preventAutoHideAsync();
|
|
27
|
-
}
|
|
28
|
-
// @needsAudit
|
|
29
|
-
/**
|
|
30
|
-
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
31
|
-
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
32
|
-
* ["Usage"](#usage) section for an example.
|
|
33
|
-
*/
|
|
34
|
-
export async function hideAsync() {
|
|
35
|
-
if (!ExpoSplashScreen.hideAsync) {
|
|
36
|
-
throw new UnavailabilityError('expo-splash-screen', 'hideAsync');
|
|
37
|
-
}
|
|
38
|
-
return await ExpoSplashScreen.hideAsync();
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* @deprecated Use `SplashScreen.hideAsync()` instead
|
|
42
|
-
* @ignore
|
|
43
|
-
*/
|
|
44
|
-
export function hide() {
|
|
45
|
-
console.warn('SplashScreen.hide() is deprecated in favour of SplashScreen.hideAsync()');
|
|
46
|
-
hideAsync();
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* @deprecated Use `SplashScreen.preventAutoHideAsync()` instead
|
|
50
|
-
* @ignore
|
|
51
|
-
*/
|
|
52
|
-
export function preventAutoHide() {
|
|
53
|
-
console.warn('SplashScreen.preventAutoHide() is deprecated in favour of SplashScreen.preventAutoHideAsync()');
|
|
54
|
-
preventAutoHideAsync();
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=SplashScreen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SplashScreen.js","sourceRoot":"","sources":["../src/SplashScreen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,cAAc;AACd;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,CAAC,gBAAgB,CAAC,oBAAoB,EAAE;QAC1C,MAAM,IAAI,mBAAmB,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;KAC7E;IACD,OAAO,MAAM,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;AACvD,CAAC;AAED,cAAc;AACd;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,IAAI,CAAC,gBAAgB,CAAC,SAAS,EAAE;QAC/B,MAAM,IAAI,mBAAmB,CAAC,oBAAoB,EAAE,WAAW,CAAC,CAAC;KAClE;IACD,OAAO,MAAM,gBAAgB,CAAC,SAAS,EAAE,CAAC;AAC5C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI;IAClB,OAAO,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAC;IACxF,SAAS,EAAE,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe;IAC7B,OAAO,CAAC,IAAI,CACV,+FAA+F,CAChG,CAAC;IACF,oBAAoB,EAAE,CAAC;AACzB,CAAC","sourcesContent":["import { UnavailabilityError } from 'expo-modules-core';\n\nimport ExpoSplashScreen from './ExpoSplashScreen';\n\n// @needsAudit\n/**\n * Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.\n *\n * > **Important note**: It is recommended to call this in global scope without awaiting, rather than\n * > inside React components or hooks, because otherwise this might be called too late,\n * > when the splash screen is already hidden.\n *\n * @example\n * ```ts\n * import * as SplashScreen from 'expo-splash-screen';\n *\n * SplashScreen.preventAutoHideAsync();\n *\n * export default function App() {\n * // ...\n * }\n * ```\n */\nexport async function preventAutoHideAsync(): Promise<boolean> {\n if (!ExpoSplashScreen.preventAutoHideAsync) {\n throw new UnavailabilityError('expo-splash-screen', 'preventAutoHideAsync');\n }\n return await ExpoSplashScreen.preventAutoHideAsync();\n}\n\n// @needsAudit\n/**\n * Hides the native splash screen immediately. Be careful to ensure that your app has content ready\n * to display when you hide the splash screen, or you may see a blank screen briefly. See the\n * [\"Usage\"](#usage) section for an example.\n */\nexport async function hideAsync(): Promise<boolean> {\n if (!ExpoSplashScreen.hideAsync) {\n throw new UnavailabilityError('expo-splash-screen', 'hideAsync');\n }\n return await ExpoSplashScreen.hideAsync();\n}\n\n/**\n * @deprecated Use `SplashScreen.hideAsync()` instead\n * @ignore\n */\nexport function hide(): void {\n console.warn('SplashScreen.hide() is deprecated in favour of SplashScreen.hideAsync()');\n hideAsync();\n}\n\n/**\n * @deprecated Use `SplashScreen.preventAutoHideAsync()` instead\n * @ignore\n */\nexport function preventAutoHide(): void {\n console.warn(\n 'SplashScreen.preventAutoHide() is deprecated in favour of SplashScreen.preventAutoHideAsync()'\n );\n preventAutoHideAsync();\n}\n"]}
|
package/src/ExpoSplashScreen.ts
DELETED
package/src/SplashScreen.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { UnavailabilityError } from 'expo-modules-core';
|
|
2
|
-
|
|
3
|
-
import ExpoSplashScreen from './ExpoSplashScreen';
|
|
4
|
-
|
|
5
|
-
// @needsAudit
|
|
6
|
-
/**
|
|
7
|
-
* Makes the native splash screen (configured in `app.json`) remain visible until `hideAsync` is called.
|
|
8
|
-
*
|
|
9
|
-
* > **Important note**: It is recommended to call this in global scope without awaiting, rather than
|
|
10
|
-
* > inside React components or hooks, because otherwise this might be called too late,
|
|
11
|
-
* > when the splash screen is already hidden.
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* ```ts
|
|
15
|
-
* import * as SplashScreen from 'expo-splash-screen';
|
|
16
|
-
*
|
|
17
|
-
* SplashScreen.preventAutoHideAsync();
|
|
18
|
-
*
|
|
19
|
-
* export default function App() {
|
|
20
|
-
* // ...
|
|
21
|
-
* }
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
export async function preventAutoHideAsync(): Promise<boolean> {
|
|
25
|
-
if (!ExpoSplashScreen.preventAutoHideAsync) {
|
|
26
|
-
throw new UnavailabilityError('expo-splash-screen', 'preventAutoHideAsync');
|
|
27
|
-
}
|
|
28
|
-
return await ExpoSplashScreen.preventAutoHideAsync();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// @needsAudit
|
|
32
|
-
/**
|
|
33
|
-
* Hides the native splash screen immediately. Be careful to ensure that your app has content ready
|
|
34
|
-
* to display when you hide the splash screen, or you may see a blank screen briefly. See the
|
|
35
|
-
* ["Usage"](#usage) section for an example.
|
|
36
|
-
*/
|
|
37
|
-
export async function hideAsync(): Promise<boolean> {
|
|
38
|
-
if (!ExpoSplashScreen.hideAsync) {
|
|
39
|
-
throw new UnavailabilityError('expo-splash-screen', 'hideAsync');
|
|
40
|
-
}
|
|
41
|
-
return await ExpoSplashScreen.hideAsync();
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use `SplashScreen.hideAsync()` instead
|
|
46
|
-
* @ignore
|
|
47
|
-
*/
|
|
48
|
-
export function hide(): void {
|
|
49
|
-
console.warn('SplashScreen.hide() is deprecated in favour of SplashScreen.hideAsync()');
|
|
50
|
-
hideAsync();
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated Use `SplashScreen.preventAutoHideAsync()` instead
|
|
55
|
-
* @ignore
|
|
56
|
-
*/
|
|
57
|
-
export function preventAutoHide(): void {
|
|
58
|
-
console.warn(
|
|
59
|
-
'SplashScreen.preventAutoHide() is deprecated in favour of SplashScreen.preventAutoHideAsync()'
|
|
60
|
-
);
|
|
61
|
-
preventAutoHideAsync();
|
|
62
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Platform } from 'react-native';
|
|
2
|
-
|
|
3
|
-
import * as SplashScreen from '../';
|
|
4
|
-
|
|
5
|
-
// Test that nothing happens on web and SSR
|
|
6
|
-
// also ensure that no errors are thrown.
|
|
7
|
-
const works = Platform.OS !== 'web';
|
|
8
|
-
|
|
9
|
-
jest.mock('../ExpoSplashScreen');
|
|
10
|
-
|
|
11
|
-
it(`preventAutoHideAsync doesn't throw`, async () => {
|
|
12
|
-
expect(await SplashScreen.preventAutoHideAsync()).toBe(works);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it(`hideAsync doesn't throw`, async () => {
|
|
16
|
-
expect(await SplashScreen.hideAsync()).toBe(works);
|
|
17
|
-
});
|