react-native-bootsplash 4.2.3 → 4.3.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/README.md CHANGED
@@ -3,11 +3,12 @@
3
3
  Show a splash screen during app startup. Hide it when you are ready.<br>
4
4
  **For migration from the v3, check the [`MIGRATION.md` guide](https://github.com/zoontek/react-native-bootsplash/blob/master/MIGRATION.md).**
5
5
 
6
- [![npm version](https://badge.fury.io/js/react-native-bootsplash.svg)](https://www.npmjs.org/package/react-native-bootsplash)
7
- [![npm](https://img.shields.io/npm/dt/react-native-bootsplash.svg)](https://www.npmjs.org/package/react-native-bootsplash)
8
- [![MIT](https://img.shields.io/dub/l/vibe-d.svg)](https://opensource.org/licenses/MIT)
9
- [![Platform - Android](https://img.shields.io/badge/platform-Android-3ddc84.svg?style=flat&logo=android)](https://www.android.com)
10
- [![Platform - iOS](https://img.shields.io/badge/platform-iOS-000.svg?style=flat&logo=apple)](https://developer.apple.com/ios)
6
+ [![mit licence](https://img.shields.io/dub/l/vibe-d.svg?style=for-the-badge)](https://github.com/zoontek/react-native-bootsplash/blob/main/LICENSE)
7
+ [![npm version](https://img.shields.io/npm/v/react-native-bootsplash?style=for-the-badge)](https://www.npmjs.org/package/react-native-bootsplash)
8
+ [![npm downloads](https://img.shields.io/npm/dt/react-native-bootsplash.svg?label=downloads&style=for-the-badge)](https://www.npmjs.org/package/react-native-bootsplash)
9
+ <br />
10
+ [![platform - android](https://img.shields.io/badge/platform-Android-3ddc84.svg?logo=android&style=for-the-badge)](https://www.android.com)
11
+ [![platform - ios](https://img.shields.io/badge/platform-iOS-000.svg?logo=apple&style=for-the-badge)](https://developer.apple.com/ios)
11
12
 
12
13
  <p>
13
14
  <img height="520" src="https://raw.githubusercontent.com/zoontek/react-native-bootsplash/HEAD/docs/ios_demo.gif?raw=true" alt="iOS demo"></img>
@@ -31,7 +32,7 @@ If your company uses it in a production app, consider sponsoring this project
31
32
  | 4.0.0+ | 0.65.0+ |
32
33
  | 3.0.0+ | 0.63.0+ |
33
34
 
34
- ## Setup
35
+ ## Installation
35
36
 
36
37
  ```bash
37
38
  $ npm install --save react-native-bootsplash
@@ -103,8 +104,6 @@ public class MainApplication extends Application implements ReactApplication {
103
104
 
104
105
  ## Setup
105
106
 
106
- ℹ️ For `react-native` < `0.68` documentation, check the [`v4.1.3 README.md`](https://github.com/zoontek/react-native-bootsplash/blob/4.1.3/README.md)
107
-
108
107
  ### Assets generation
109
108
 
110
109
  In order to speed up the setup, we provide a **CLI** to generate assets, create the Android Drawable XML file and the iOS Storyboard file automatically ✨.
@@ -182,7 +181,7 @@ _⚠️  Only `.storyboard` files are supported ([Apple has deprecated other m
182
181
 
183
182
  ---
184
183
 
185
- Edit the `ios/YourProjectName/AppDelegate.mm` file:
184
+ Edit the `ios/YourProjectName/AppDelegate.m(m)` file:
186
185
 
187
186
  ```obj-c
188
187
  #import "AppDelegate.h"
@@ -238,7 +237,7 @@ dependencies {
238
237
  // …
239
238
 
240
239
  implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
241
- implementation "androidx.core:core-splashscreen:1.0.0-rc01" // Add this line
240
+ implementation "androidx.core:core-splashscreen:1.0.0" // Add this line
242
241
 
243
242
  // …
244
243
  ```
@@ -286,24 +285,20 @@ dependencies {
286
285
  5. Finally edit your `android/app/src/main/java/com/yourprojectname/MainActivity.java` file:
287
286
 
288
287
  ```java
289
- import com.facebook.react.ReactActivity;
290
- import com.facebook.react.ReactActivityDelegate;
291
- import com.facebook.react.ReactRootView;
292
- import com.zoontek.rnbootsplash.RNBootSplash; // <- add this necessary import
288
+ //
289
+
290
+ // Add these required imports:
291
+ import android.os.Bundle;
292
+ import com.zoontek.rnbootsplash.RNBootSplash;
293
293
 
294
294
  public class MainActivity extends ReactActivity {
295
295
 
296
296
  // …
297
297
 
298
- public static class MainActivityDelegate extends ReactActivityDelegate {
299
-
300
- //
301
-
302
- @Override
303
- protected void loadApp(String appKey) {
304
- RNBootSplash.init(getPlainActivity()); // <- initialize the splash screen
305
- super.loadApp(appKey);
306
- }
298
+ @Override
299
+ protected void onCreate(Bundle savedInstanceState) {
300
+ RNBootSplash.init(this); // <- initialize the splash screen
301
+ super.onCreate(savedInstanceState); // or super.onCreate(null) with react-native-screens
307
302
  }
308
303
  }
309
304
  ```
@@ -387,7 +382,6 @@ function App() {
387
382
  }
388
383
  ```
389
384
 
390
-
391
385
  ## With react-native-bars
392
386
 
393
387
  In order to keep fully transparent status and navigation bars on Android once the splash screen is hidden (and control them), this library play nicely with [react-native-bars](https://github.com/zoontek/react-native-bars). Check the [README](https://github.com/zoontek/react-native-bars/blob/main/README.md#with-react-native-bootsplash) for more informations.
@@ -49,5 +49,5 @@ repositories {
49
49
  dependencies {
50
50
  //noinspection GradleDynamicVersion
51
51
  implementation "com.facebook.react:react-native:+" // From node_modules
52
- implementation "androidx.core:core-splashscreen:${safeExtGet("androidXSplashScreenVersion", "1.0.0-rc01")}"
52
+ implementation "androidx.core:core-splashscreen:${safeExtGet("androidXSplashScreenVersion", "1.0.0")}"
53
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-bootsplash",
3
- "version": "4.2.3",
3
+ "version": "4.3.1",
4
4
  "license": "MIT",
5
5
  "description": "Display a bootsplash on your app starts. Hide it when you want.",
6
6
  "author": "Mathieu Acthernoene <zoontek@gmail.com>",
@@ -37,8 +37,8 @@
37
37
  ],
38
38
  "scripts": {
39
39
  "format": "prettier '**/*' -u -w",
40
- "setup-hooks": "git config --local core.hooksPath .hooks",
41
- "prepare": "yarn setup-hooks && bob build"
40
+ "postinstall": "git config --local core.hooksPath .hooks",
41
+ "prepack": "bob build"
42
42
  },
43
43
  "react-native-builder-bob": {
44
44
  "source": "src",
@@ -71,12 +71,12 @@
71
71
  },
72
72
  "devDependencies": {
73
73
  "@types/fs-extra": "^9.0.13",
74
- "@types/react-native": "^0.68.0",
75
- "lint-staged": "^13.0.2",
74
+ "@types/react-native": "^0.69.5",
75
+ "lint-staged": "^13.0.3",
76
76
  "prettier": "^2.7.1",
77
- "prettier-plugin-organize-imports": "^3.0.0",
77
+ "prettier-plugin-organize-imports": "^3.0.3",
78
78
  "react": "^18.0.0",
79
- "react-native": "^0.69.0",
79
+ "react-native": "^0.69.4",
80
80
  "react-native-builder-bob": "^0.18.3",
81
81
  "rescript": "^9.1.4",
82
82
  "typescript": "^4.7.4"
@@ -54,14 +54,17 @@ module.exports = {
54
54
 
55
55
  return generate({
56
56
  android,
57
- ios: {
58
- ...ios,
59
- // Fix to support previous CLI versions
60
- projectPath: (ios.xcodeProject
61
- ? path.resolve(ios.sourceDir, ios.xcodeProject.name)
62
- : ios.projectPath
63
- ).replace(/\.(xcodeproj|xcworkspace)$/, ""),
64
- },
57
+
58
+ ios: ios
59
+ ? {
60
+ ...ios,
61
+ // Fix to support previous CLI versions
62
+ projectPath: (ios.xcodeProject
63
+ ? path.resolve(ios.sourceDir, ios.xcodeProject.name)
64
+ : ios.projectPath
65
+ ).replace(/\.(xcodeproj|xcworkspace)$/, ""),
66
+ }
67
+ : null,
65
68
 
66
69
  workingPath,
67
70
  logoPath: path.resolve(workingPath, logoPath),