expo-splash-screen 0.15.0 → 0.16.1

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,20 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.16.1 — 2022-07-16
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed splash screen not showing when reloading apps on iOS. ([#18229](https://github.com/expo/expo/pull/18229) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 0.16.0 — 2022-07-07
20
+
21
+ _This version does not introduce any user-facing changes._
22
+
23
+ ## 0.15.1 — 2022-04-27
24
+
25
+ _This version does not introduce any user-facing changes._
26
+
13
27
  ## 0.15.0 — 2022-04-18
14
28
 
15
29
  ### 💡 Others
@@ -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.15.0'
6
+ version = '0.16.1'
7
7
 
8
8
  buildscript {
9
9
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
@@ -74,7 +74,7 @@ android {
74
74
  minSdkVersion safeExtGet('minSdkVersion', 21)
75
75
  targetSdkVersion safeExtGet("targetSdkVersion", 31)
76
76
  versionCode 17
77
- versionName '0.15.0'
77
+ versionName '0.16.1'
78
78
  }
79
79
  lintOptions {
80
80
  abortOnError false
@@ -1,5 +1,20 @@
1
1
  /**
2
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
+ * ```
3
18
  */
4
19
  export declare function preventAutoHideAsync(): Promise<boolean>;
5
20
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"SplashScreen.d.ts","sourceRoot":"","sources":["../src/SplashScreen.ts"],"names":[],"mappings":"AAKA;;GAEG;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"}
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"}
@@ -3,6 +3,21 @@ import ExpoSplashScreen from './ExpoSplashScreen';
3
3
  // @needsAudit
4
4
  /**
5
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
+ * ```
6
21
  */
7
22
  export async function preventAutoHideAsync() {
8
23
  if (!ExpoSplashScreen.preventAutoHideAsync) {
@@ -1 +1 @@
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;;GAEG;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 */\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"]}
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"]}
@@ -39,6 +39,7 @@ EX_EXPORT_METHOD_AS(hideAsync,
39
39
  EX_ENSURE_STRONGIFY(self);
40
40
  UIViewController *currentViewController = [self reactViewController];
41
41
  [[self splashScreenService] hideSplashScreenFor:currentViewController
42
+ options:EXSplashScreenDefault
42
43
  successCallback:^(BOOL hasEffect){ resolve(@(hasEffect)); }
43
44
  failureCallback:^(NSString *message){ reject(@"ERR_SPLASH_SCREEN_CANNOT_HIDE", message, nil); }];
44
45
  });
@@ -53,6 +54,7 @@ EX_EXPORT_METHOD_AS(preventAutoHideAsync,
53
54
  EX_ENSURE_STRONGIFY(self);
54
55
  UIViewController *currentViewController = [self reactViewController];
55
56
  [[self splashScreenService] preventSplashScreenAutoHideFor:currentViewController
57
+ options:EXSplashScreenDefault
56
58
  successCallback:^(BOOL hasEffect){ resolve(@(hasEffect)); }
57
59
  failureCallback:^(NSString *message){ reject(@"ERR_SPLASH_SCREEN_CANNOT_PREVENT_AUTOHIDE", message, nil); }];
58
60
  });
@@ -8,6 +8,14 @@
8
8
 
9
9
  NS_ASSUME_NONNULL_BEGIN
10
10
 
11
+ typedef NS_OPTIONS(NSUInteger, EXSplashScreenOptions) {
12
+ EXSplashScreenDefault = 0,
13
+
14
+ // Show splash screen even it was already shown before.
15
+ // e.g. show splash screen again when reloading apps,
16
+ EXSplashScreenForceShow = 1 << 0,
17
+ };
18
+
11
19
  /**
12
20
  * Entry point for handling SplashScreen associated mechanism.
13
21
  * This class has state based on the following relation { ViewController -> ApplicationSplashScreenState }.
@@ -18,13 +26,15 @@ NS_ASSUME_NONNULL_BEGIN
18
26
  /**
19
27
  * Overloaded method. See main method below.
20
28
  */
21
- - (void)showSplashScreenFor:(UIViewController *)viewController;
29
+ - (void)showSplashScreenFor:(UIViewController *)viewController
30
+ options:(EXSplashScreenOptions)options;
22
31
 
23
32
  /**
24
33
  * Entry point for SplashScreen unimodule.
25
34
  * Registers SplashScreen for given viewController and presents it in that viewController.
26
35
  */
27
36
  - (void)showSplashScreenFor:(UIViewController *)viewController
37
+ options:(EXSplashScreenOptions)options
28
38
  splashScreenViewProvider:(id<EXSplashScreenViewProvider>)splashScreenViewProvider
29
39
  successCallback:(void (^)(void))successCallback
30
40
  failureCallback:(void (^)(NSString *message))failureCallback;
@@ -34,6 +44,7 @@ NS_ASSUME_NONNULL_BEGIN
34
44
  * Registers SplashScreen for given viewController and EXSplashController and presents it in that viewController.
35
45
  */
36
46
  -(void)showSplashScreenFor:(UIViewController *)viewController
47
+ options:(EXSplashScreenOptions)options
37
48
  splashScreenController:(EXSplashScreenViewController *)splashScreenController
38
49
  successCallback:(void (^)(void))successCallback
39
50
  failureCallback:(void (^)(NSString *message))failureCallback;
@@ -42,6 +53,7 @@ NS_ASSUME_NONNULL_BEGIN
42
53
  * Hides SplashScreen for given viewController.
43
54
  */
44
55
  - (void)hideSplashScreenFor:(UIViewController *)viewController
56
+ options:(EXSplashScreenOptions)options
45
57
  successCallback:(void (^)(BOOL hasEffect))successCallback
46
58
  failureCallback:(void (^)(NSString *message))failureCallback;
47
59
 
@@ -49,6 +61,7 @@ NS_ASSUME_NONNULL_BEGIN
49
61
  * Prevents SplashScreen from default autohiding.
50
62
  */
51
63
  - (void)preventSplashScreenAutoHideFor:(UIViewController *)viewController
64
+ options:(EXSplashScreenOptions)options
52
65
  successCallback:(void (^)(BOOL hasEffect))successCallback
53
66
  failureCallback:(void (^)(NSString *message))failureCallback;
54
67
 
@@ -36,9 +36,11 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
36
36
  }
37
37
 
38
38
  - (void)showSplashScreenFor:(UIViewController *)viewController
39
+ options:(EXSplashScreenOptions)options
39
40
  {
40
41
  id<EXSplashScreenViewProvider> splashScreenViewProvider = [EXSplashScreenViewNativeProvider new];
41
42
  return [self showSplashScreenFor:viewController
43
+ options:options
42
44
  splashScreenViewProvider:splashScreenViewProvider
43
45
  successCallback:^{}
44
46
  failureCallback:^(NSString *message){ EXLogWarn(@"%@", message); }];
@@ -46,11 +48,12 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
46
48
 
47
49
 
48
50
  - (void)showSplashScreenFor:(UIViewController *)viewController
51
+ options:(EXSplashScreenOptions)options
49
52
  splashScreenViewProvider:(id<EXSplashScreenViewProvider>)splashScreenViewProvider
50
53
  successCallback:(void (^)(void))successCallback
51
54
  failureCallback:(void (^)(NSString * _Nonnull))failureCallback
52
55
  {
53
- if ([self.splashScreenControllers objectForKey:viewController]) {
56
+ if ((options & EXSplashScreenForceShow) == 0 && [self.splashScreenControllers objectForKey:viewController]) {
54
57
  return failureCallback(@"'SplashScreen.show' has already been called for given view controller.");
55
58
  }
56
59
 
@@ -61,17 +64,19 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
61
64
  splashScreenView:splashScreenView];
62
65
 
63
66
  [self showSplashScreenFor:viewController
67
+ options:options
64
68
  splashScreenController:splashScreenController
65
69
  successCallback:successCallback
66
70
  failureCallback:failureCallback];
67
71
  }
68
72
 
69
73
  - (void)showSplashScreenFor:(UIViewController *)viewController
74
+ options:(EXSplashScreenOptions)options
70
75
  splashScreenController:(EXSplashScreenViewController *)splashScreenController
71
76
  successCallback:(void (^)(void))successCallback
72
77
  failureCallback:(void (^)(NSString * _Nonnull))failureCallback
73
78
  {
74
- if ([self.splashScreenControllers objectForKey:viewController]) {
79
+ if ((options & EXSplashScreenForceShow) == 0 && [self.splashScreenControllers objectForKey:viewController]) {
75
80
  return failureCallback(@"'SplashScreen.show' has already been called for given view controller.");
76
81
  }
77
82
 
@@ -81,6 +86,7 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
81
86
  }
82
87
 
83
88
  - (void)preventSplashScreenAutoHideFor:(UIViewController *)viewController
89
+ options:(EXSplashScreenOptions)options
84
90
  successCallback:(void (^)(BOOL hasEffect))successCallback
85
91
  failureCallback:(void (^)(NSString * _Nonnull))failureCallback
86
92
  {
@@ -93,6 +99,7 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
93
99
  }
94
100
 
95
101
  - (void)hideSplashScreenFor:(UIViewController *)viewController
102
+ options:(EXSplashScreenOptions)options
96
103
  successCallback:(void (^)(BOOL hasEffect))successCallback
97
104
  failureCallback:(void (^)(NSString * _Nonnull))failureCallback
98
105
  {
@@ -113,6 +120,7 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
113
120
  BOOL needsHide = [[self.splashScreenControllers objectForKey:viewController] needsHideOnAppContentDidAppear];
114
121
  if (needsHide) {
115
122
  [self hideSplashScreenFor:viewController
123
+ options:EXSplashScreenDefault
116
124
  successCallback:^(BOOL hasEffect){}
117
125
  failureCallback:^(NSString *message){}];
118
126
  }
@@ -125,7 +133,9 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
125
133
  }
126
134
  BOOL needsShow = [[self.splashScreenControllers objectForKey:viewController] needsShowOnAppContentWillReload];
127
135
  if (needsShow) {
136
+ // For reloading apps, specify `EXSplashScreenForceShow` to show splash screen again
128
137
  [self showSplashScreenFor:viewController
138
+ options:EXSplashScreenForceShow
129
139
  splashScreenController:[self.splashScreenControllers objectForKey:viewController]
130
140
  successCallback:^{}
131
141
  failureCallback:^(NSString *message){}];
@@ -138,7 +148,7 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
138
148
  {
139
149
  UIViewController *rootViewController = [[application keyWindow] rootViewController];
140
150
  if (rootViewController) {
141
- [self showSplashScreenFor:rootViewController];
151
+ [self showSplashScreenFor:rootViewController options:EXSplashScreenDefault];
142
152
  }
143
153
 
144
154
  [self addRootViewControllerListener];
@@ -180,7 +190,7 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
180
190
  UIViewController *newRootViewController = change[@"new"];
181
191
  if (newRootViewController != nil) {
182
192
  [self removeRootViewControllerListener];
183
- [self showSplashScreenFor:newRootViewController];
193
+ [self showSplashScreenFor:newRootViewController options:EXSplashScreenDefault];
184
194
  [self addRootViewControllerListener];
185
195
  }
186
196
  }
@@ -190,9 +200,9 @@ EX_REGISTER_SINGLETON_MODULE(SplashScreen);
190
200
  UIViewController *viewController = (UIViewController *)newView.nextResponder;
191
201
  // To show splash screen as soon as possible, we do not wait for hiding callback and call showSplashScreen immediately.
192
202
  // GCD main queue should keep the calls in sequence.
193
- [self hideSplashScreenFor:viewController successCallback:^(BOOL hasEffect){} failureCallback:^(NSString *message){}];
203
+ [self hideSplashScreenFor:viewController options:EXSplashScreenDefault successCallback:^(BOOL hasEffect){} failureCallback:^(NSString *message){}];
194
204
  [self.splashScreenControllers removeObjectForKey:viewController];
195
- [self showSplashScreenFor:viewController];
205
+ [self showSplashScreenFor:viewController options:EXSplashScreenDefault];
196
206
  }
197
207
  }
198
208
  }
@@ -6,30 +6,30 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64</string>
9
+ <string>ios-arm64_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>EXSplashScreen.framework</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
+ <string>x86_64</string>
15
16
  </array>
16
17
  <key>SupportedPlatform</key>
17
18
  <string>ios</string>
19
+ <key>SupportedPlatformVariant</key>
20
+ <string>simulator</string>
18
21
  </dict>
19
22
  <dict>
20
23
  <key>LibraryIdentifier</key>
21
- <string>ios-arm64_x86_64-simulator</string>
24
+ <string>ios-arm64</string>
22
25
  <key>LibraryPath</key>
23
26
  <string>EXSplashScreen.framework</string>
24
27
  <key>SupportedArchitectures</key>
25
28
  <array>
26
29
  <string>arm64</string>
27
- <string>x86_64</string>
28
30
  </array>
29
31
  <key>SupportedPlatform</key>
30
32
  <string>ios</string>
31
- <key>SupportedPlatformVariant</key>
32
- <string>simulator</string>
33
33
  </dict>
34
34
  </array>
35
35
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-splash-screen",
3
- "version": "0.15.0",
3
+ "version": "0.16.1",
4
4
  "description": "Provides a module to allow keeping the native Splash Screen visible until you choose to hide it.",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@expo/configure-splash-screen": "^0.6.0",
41
- "@expo/prebuild-config": "^3.0.15"
41
+ "@expo/prebuild-config": "~5.0.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "expo-module-scripts": "^2.0.0"
@@ -46,5 +46,5 @@
46
46
  "peerDependencies": {
47
47
  "expo": "*"
48
48
  },
49
- "gitHead": "22dce752354bb429c84851bc4389abe47a766b1f"
49
+ "gitHead": "c6678c65b68e45062d49a2deea8e822f69388278"
50
50
  }
@@ -5,6 +5,21 @@ import ExpoSplashScreen from './ExpoSplashScreen';
5
5
  // @needsAudit
6
6
  /**
7
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
+ * ```
8
23
  */
9
24
  export async function preventAutoHideAsync(): Promise<boolean> {
10
25
  if (!ExpoSplashScreen.preventAutoHideAsync) {
package/tsconfig.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "outDir": "./build"
6
6
  },
7
7
  "include": ["./src"],
8
- "exclude": ["**/__mocks__/*", "**/__tests__/*"]
8
+ "exclude": ["**/__mocks__/*", "**/__tests__/*", "**/__stories__/*"]
9
9
  }
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "/Users/tomasz/Work/expo/packages/expo-splash-screen/tsconfig.json",
3
- "compilerOptions": {
4
- "module": "esnext",
5
- "typeRoots": [
6
- "./node_modules/@types",
7
- "../node_modules/@types",
8
- "../../node_modules/@types",
9
- "../../../node_modules/@types",
10
- "/Users/tomasz/Work/expo/packages/expo-module-scripts/ts-declarations"
11
- ]
12
- }
13
- }