react-native-custom-splash 2.1.0 → 2.1.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/package.json +1 -1
- package/plugin/src/index.js +30 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-custom-splash",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A custom splash screen module for React Native with native iOS and Android support, fully compatible with Expo",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"types": "src/index.d.ts",
|
package/plugin/src/index.js
CHANGED
|
@@ -430,7 +430,19 @@ function createLaunchScreenStoryboard(hasImage, hasLogo, backgroundColor) {
|
|
|
430
430
|
* Plugin to configure iOS splash screen
|
|
431
431
|
*/
|
|
432
432
|
const withSplashScreenIOS = (config, pluginConfig) => {
|
|
433
|
-
|
|
433
|
+
// Step 1: Update Info.plist to use our LaunchScreen
|
|
434
|
+
config = IOSConfig.InfoPlist.withInfoPlist(config, (config) => {
|
|
435
|
+
// Set our LaunchScreen as the launch storyboard
|
|
436
|
+
config.modResults.UILaunchStoryboardName = 'LaunchScreen';
|
|
437
|
+
|
|
438
|
+
// Remove Expo's default splash screen configuration
|
|
439
|
+
delete config.modResults.UILaunchScreen;
|
|
440
|
+
|
|
441
|
+
return config;
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
// Step 2: Create our custom LaunchScreen.storyboard and copy images
|
|
445
|
+
config = withDangerousMod(config, [
|
|
434
446
|
'ios',
|
|
435
447
|
async (config) => {
|
|
436
448
|
const projectRoot = config.modRequest.projectRoot;
|
|
@@ -476,11 +488,27 @@ const withSplashScreenIOS = (config, pluginConfig) => {
|
|
|
476
488
|
|
|
477
489
|
fs.writeFileSync(launchScreenPath, storyboardContent);
|
|
478
490
|
|
|
479
|
-
|
|
491
|
+
// Remove SplashScreenLegacy if it exists (from Expo's default splash)
|
|
492
|
+
const legacyPath = path.join(
|
|
493
|
+
iosProjectPath,
|
|
494
|
+
projectName,
|
|
495
|
+
'Images.xcassets',
|
|
496
|
+
'SplashScreenLegacy.imageset'
|
|
497
|
+
);
|
|
498
|
+
|
|
499
|
+
if (fs.existsSync(legacyPath)) {
|
|
500
|
+
fs.rmSync(legacyPath, { recursive: true, force: true });
|
|
501
|
+
console.log('🗑️ Removed SplashScreenLegacy');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
console.log('✅ iOS LaunchScreen.storyboard created with YOUR images!');
|
|
505
|
+
console.log('✅ Info.plist configured to use LaunchScreen');
|
|
480
506
|
|
|
481
507
|
return config;
|
|
482
508
|
},
|
|
483
509
|
]);
|
|
510
|
+
|
|
511
|
+
return config;
|
|
484
512
|
};
|
|
485
513
|
|
|
486
514
|
/**
|
|
@@ -498,7 +526,6 @@ module.exports = (config, props = {}) => {
|
|
|
498
526
|
pluginConfig = getPluginConfig(config);
|
|
499
527
|
}
|
|
500
528
|
|
|
501
|
-
|
|
502
529
|
return withPlugins(config, [
|
|
503
530
|
[withSplashScreenAndroid, pluginConfig],
|
|
504
531
|
[withSplashScreenIOS, pluginConfig],
|