{"_id":"@abeman/react-native-nitro-splash","_rev":"4-c658f8786919b2378ccedf69264c62ee","name":"@abeman/react-native-nitro-splash","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.0":{"name":"@abeman/react-native-nitro-splash","version":"0.1.0","keywords":["react-native","ios","android"],"author":{"url":"https://github.com/huynq1175","name":"Babear","email":"huynq1175@gmail.com"},"license":"MIT","_id":"@abeman/react-native-nitro-splash@0.1.0","maintainers":[{"name":"huynq1175","email":"huynq1175@gmail.com"}],"homepage":"https://github.com/huynq1175/react-native-splash-screen#readme","bugs":{"url":"https://github.com/huynq1175/react-native-splash-screen/issues"},"dist":{"shasum":"492b86c891ecabb08d63dc6e0e57d885920fe346","tarball":"https://registry.npmjs.org/@abeman/react-native-nitro-splash/-/react-native-nitro-splash-0.1.0.tgz","fileCount":47,"integrity":"sha512-eViyvpbe9fjkBAtIOeYMMpcbtKIZzj7grzex5W+7++eAZ9FosVjmK6xx8tSVMMPbl3EBpWJT1aCboYK224WMzA==","signatures":[{"sig":"MEUCIDVH1b0bJ541SfKbmSI8LVENMHCQW72odXQ0b28YKCIsAiEAyUFKqGUsrfv0rZeUVKNypGuCZq/Av8QBR5iyh2SLo2Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79333},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","exports":{".":{"types":"./lib/typescript/src/index.d.ts","source":"./src/index.tsx","default":"./lib/module/index.js"},"./package.json":"./package.json"},"gitHead":"db125efae07c714ab744569cd0768fed667d95ec","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-splash-screen-example","prepare":"bob build","release":"release-it --only-version","nitrogen":"nitrogen","typecheck":"tsc"},"_npmUser":{"name":"huynq1175","email":"huynq1175@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"repository":{"url":"git+https://github.com/huynq1175/react-native-splash-screen.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.11.1","description":"A high-performance splash screen for React Native","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"jest":"^29.7.0","react":"19.2.0","turbo":"^2.5.6","eslint":"^9.35.0","del-cli":"^6.0.0","lefthook":"^2.0.3","nitrogen":"^0.35.2","prettier":"^2.8.8","@eslint/js":"^9.35.0","commitlint":"^19.8.1","release-it":"^19.0.4","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/react":"^19.2.0","react-native":"0.83.0","@eslint/compat":"^1.3.2","@eslint/eslintrc":"^3.3.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","react-native-builder-bob":"^0.40.18","@react-native/babel-preset":"0.83.0","react-native-nitro-modules":"^0.35.2","@react-native/eslint-config":"0.83.0","@commitlint/config-conventional":"^19.8.1","@release-it/conventional-changelog":"^10.0.1"},"peerDependencies":{"react":"*","react-native":"*","lottie-react-native":">=7.0.0","react-native-nitro-modules":"^0.35.2"},"peerDependenciesMeta":{"lottie-react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-native-nitro-splash_0.1.0_1774347370512_0.09328078416605523","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["custom",{"clean":"nitrogen/","script":"nitrogen"}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"nitro-module","tools":["jest","lefthook","release-it","eslint"],"version":"0.57.2","languages":"kotlin-swift"}},"0.1.1":{"name":"@abeman/react-native-nitro-splash","version":"0.1.1","keywords":["react-native","ios","android"],"author":{"url":"https://github.com/huynq1175","name":"Babear","email":"huynq1175@gmail.com"},"license":"MIT","_id":"@abeman/react-native-nitro-splash@0.1.1","maintainers":[{"name":"huynq1175","email":"huynq1175@gmail.com"}],"homepage":"https://github.com/huynq1175/react-native-splash-screen#readme","bugs":{"url":"https://github.com/huynq1175/react-native-splash-screen/issues"},"dist":{"shasum":"e6fcb4c8c6a48a5ab405cbb6c3ba8fb297bbfd20","tarball":"https://registry.npmjs.org/@abeman/react-native-nitro-splash/-/react-native-nitro-splash-0.1.1.tgz","fileCount":47,"integrity":"sha512-Aie/XpbAc2KKG0WcuOPpwFkxtYz2kWA1KrHZWbwFvf32KNc5ifeZRRfE+ktOFnLY1i6AR9GqFHevwnS8RneZqg==","signatures":[{"sig":"MEYCIQC/4pvIiTmIF2eEq++gNkc60mxvAJ18POGq53h2ZOUZcwIhAInRIJmiS/295PWyUQV1TaXMIV4MEO9+rBjup0pC08TP","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79333},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","exports":{".":{"types":"./lib/typescript/src/index.d.ts","source":"./src/index.tsx","default":"./lib/module/index.js"},"./package.json":"./package.json"},"gitHead":"db125efae07c714ab744569cd0768fed667d95ec","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-splash-screen-example","prepare":"bob build","release":"release-it --only-version","nitrogen":"nitrogen","typecheck":"tsc"},"_npmUser":{"name":"huynq1175","email":"huynq1175@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"repository":{"url":"git+https://github.com/huynq1175/react-native-splash-screen.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.11.1","description":"A high-performance splash screen for React Native","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"jest":"^29.7.0","react":"19.2.0","turbo":"^2.5.6","eslint":"^9.35.0","del-cli":"^6.0.0","lefthook":"^2.0.3","nitrogen":"^0.35.2","prettier":"^2.8.8","@eslint/js":"^9.35.0","commitlint":"^19.8.1","release-it":"^19.0.4","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/react":"^19.2.0","react-native":"0.83.0","@eslint/compat":"^1.3.2","@eslint/eslintrc":"^3.3.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","react-native-builder-bob":"^0.40.18","@react-native/babel-preset":"0.83.0","react-native-nitro-modules":"^0.35.2","@react-native/eslint-config":"0.83.0","@commitlint/config-conventional":"^19.8.1","@release-it/conventional-changelog":"^10.0.1"},"peerDependencies":{"react":"*","react-native":"*","lottie-react-native":">=7.0.0","react-native-nitro-modules":"^0.35.2"},"peerDependenciesMeta":{"lottie-react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-native-nitro-splash_0.1.1_1774347641097_0.12972083411701996","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["custom",{"clean":"nitrogen/","script":"nitrogen"}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"nitro-module","tools":["jest","lefthook","release-it","eslint"],"version":"0.57.2","languages":"kotlin-swift"}},"0.1.2":{"name":"@abeman/react-native-nitro-splash","version":"0.1.2","keywords":["react-native","ios","android"],"author":{"url":"https://github.com/huynq1175","name":"Babear","email":"huynq1175@gmail.com"},"license":"MIT","_id":"@abeman/react-native-nitro-splash@0.1.2","maintainers":[{"name":"huynq1175","email":"huynq1175@gmail.com"}],"homepage":"https://github.com/huynq1175/react-native-splash-screen#readme","bugs":{"url":"https://github.com/huynq1175/react-native-splash-screen/issues"},"dist":{"shasum":"2d11811b8fe9d9ed2e5ab64d6fde218fa585b2c1","tarball":"https://registry.npmjs.org/@abeman/react-native-nitro-splash/-/react-native-nitro-splash-0.1.2.tgz","fileCount":47,"integrity":"sha512-CKbjJbmVWCHmkhqFXM0RSzvSsc4JihtWeE7luQuiO0AgAHtgFhBywKNPBwPmW+e94zbAoa40qPhQyNzUOj8+0A==","signatures":[{"sig":"MEUCIQCi+Uz5LH4+9t81dFPjPb4EAlA2pfVp33u1xeODezOv8gIgV2X7Xou6cc9NHEOXx/6PlDivIFnQAoCs1QsfOBLqx+c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":79412},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"main":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","exports":{".":{"types":"./lib/typescript/src/index.d.ts","source":"./src/index.tsx","default":"./lib/module/index.js"},"./package.json":"./package.json"},"gitHead":"f4dd6775ff328d9ec486e6372e3221a984d478be","scripts":{"lint":"eslint \"**/*.{js,ts,tsx}\"","test":"jest","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","example":"yarn workspace react-native-splash-screen-example","prepare":"bob build","release":"release-it --only-version","nitrogen":"nitrogen","typecheck":"tsc"},"_npmUser":{"name":"huynq1175","email":"huynq1175@gmail.com"},"prettier":{"useTabs":false,"tabWidth":2,"quoteProps":"consistent","singleQuote":true,"trailingComma":"es5"},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"tagName":"v${version}","commitMessage":"chore: release ${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"repository":{"url":"git+https://github.com/huynq1175/react-native-splash-screen.git","type":"git"},"workspaces":["example"],"_npmVersion":"11.11.1","description":"A high-performance splash screen for React Native","directories":{},"_nodeVersion":"24.8.0","publishConfig":{"registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.11.0","devDependencies":{"jest":"^29.7.0","react":"19.2.0","turbo":"^2.5.6","eslint":"^9.35.0","del-cli":"^6.0.0","lefthook":"^2.0.3","nitrogen":"^0.35.2","prettier":"^2.8.8","@eslint/js":"^9.35.0","commitlint":"^19.8.1","release-it":"^19.0.4","typescript":"^5.9.2","@types/jest":"^29.5.14","@types/react":"^19.2.0","react-native":"0.83.0","@eslint/compat":"^1.3.2","@eslint/eslintrc":"^3.3.1","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","react-native-builder-bob":"^0.40.18","@react-native/babel-preset":"0.83.0","react-native-nitro-modules":"^0.35.2","@react-native/eslint-config":"0.83.0","@commitlint/config-conventional":"^19.8.1","@release-it/conventional-changelog":"^10.0.1"},"peerDependencies":{"react":"*","react-native":"*","lottie-react-native":">=7.0.0","react-native-nitro-modules":"^0.35.2"},"peerDependenciesMeta":{"lottie-react-native":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/react-native-nitro-splash_0.1.2_1774531197040_0.6992295396768382","host":"s3://npm-registry-packages-npm-production"},"react-native-builder-bob":{"output":"lib","source":"src","targets":[["custom",{"clean":"nitrogen/","script":"nitrogen"}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json"}]]},"create-react-native-library":{"type":"nitro-module","tools":["jest","lefthook","release-it","eslint"],"version":"0.57.2","languages":"kotlin-swift"}},"0.1.3":{"name":"@abeman/react-native-nitro-splash","version":"0.1.3","description":"A high-performance splash screen for React Native","main":"./lib/module/index.js","types":"./lib/typescript/src/index.d.ts","exports":{".":{"source":"./src/index.tsx","types":"./lib/typescript/src/index.d.ts","default":"./lib/module/index.js"},"./package.json":"./package.json"},"scripts":{"example":"yarn workspace react-native-splash-screen-example","clean":"del-cli android/build example/android/build example/android/app/build example/ios/build lib","prepare":"bob build","nitrogen":"nitrogen","typecheck":"tsc","test":"jest","release":"release-it --only-version","lint":"eslint \"**/*.{js,ts,tsx}\""},"keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/huynq1175/react-native-splash-screen.git"},"author":{"name":"Babear","email":"huynq1175@gmail.com","url":"https://github.com/huynq1175"},"license":"MIT","bugs":{"url":"https://github.com/huynq1175/react-native-splash-screen/issues"},"homepage":"https://github.com/huynq1175/react-native-splash-screen#readme","publishConfig":{"registry":"https://registry.npmjs.org/"},"devDependencies":{"@commitlint/config-conventional":"^19.8.1","@eslint/compat":"^1.3.2","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.35.0","@react-native/babel-preset":"0.83.0","@react-native/eslint-config":"0.83.0","@release-it/conventional-changelog":"^10.0.1","@types/jest":"^29.5.14","@types/react":"^19.2.0","commitlint":"^19.8.1","del-cli":"^6.0.0","eslint":"^9.35.0","eslint-config-prettier":"^10.1.8","eslint-plugin-prettier":"^5.5.4","jest":"^29.7.0","lefthook":"^2.0.3","nitrogen":"^0.35.2","prettier":"^2.8.8","react":"19.2.0","react-native":"0.83.0","react-native-builder-bob":"^0.40.18","react-native-nitro-modules":"^0.35.2","release-it":"^19.0.4","turbo":"^2.5.6","typescript":"^5.9.2"},"peerDependencies":{"lottie-react-native":">=7.0.0","react":"*","react-native":"*","react-native-nitro-modules":"^0.35.2"},"peerDependenciesMeta":{"lottie-react-native":{"optional":true}},"workspaces":["example"],"packageManager":"yarn@4.11.0","react-native-builder-bob":{"source":"src","output":"lib","targets":[["custom",{"script":"nitrogen","clean":"nitrogen/"}],["module",{"esm":true}],["typescript",{"project":"tsconfig.build.json"}]]},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/node_modules","<rootDir>/lib/"]},"commitlint":{"extends":["@commitlint/config-conventional"]},"release-it":{"git":{"commitMessage":"chore: release ${version}","tagName":"v${version}"},"npm":{"publish":true},"github":{"release":true},"plugins":{"@release-it/conventional-changelog":{"preset":{"name":"angular"}}}},"prettier":{"quoteProps":"consistent","singleQuote":true,"tabWidth":2,"trailingComma":"es5","useTabs":false},"create-react-native-library":{"type":"nitro-module","languages":"kotlin-swift","tools":["jest","lefthook","release-it","eslint"],"version":"0.57.2"},"_id":"@abeman/react-native-nitro-splash@0.1.3","gitHead":"c277f873e642ce2395aeb37ad11bb83661840401","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-kxjh9PKajUuYhYH3r3evgE72aaPPv7RBMATY/MjwiojiV3P3QaXnrOKhEm09crAjQPdBFRcqmUYIQ6oRmKspQw==","shasum":"3ea8578dcf969b9ce7e21dfe702737c9da756def","tarball":"https://registry.npmjs.org/@abeman/react-native-nitro-splash/-/react-native-nitro-splash-0.1.3.tgz","fileCount":47,"unpackedSize":85482,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCP9Kv8rLEHBo8MmTZA/gIdV6/H7o+/aLi3QesTg8PwdgIgHZS3Zv/UJQoxvoyVoR1K3gkoLGA2oRZlH+Dn+so3vyo="}]},"_npmUser":{"name":"huynq1175","email":"huynq1175@gmail.com"},"directories":{},"maintainers":[{"name":"huynq1175","email":"huynq1175@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/react-native-nitro-splash_0.1.3_1782287825595_0.953139220343491"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T10:16:10.432Z","modified":"2026-06-24T07:57:05.845Z","0.1.0":"2026-03-24T10:16:10.657Z","0.1.1":"2026-03-24T10:20:41.262Z","0.1.2":"2026-03-26T13:19:57.166Z","0.1.3":"2026-06-24T07:57:05.709Z"},"bugs":{"url":"https://github.com/huynq1175/react-native-splash-screen/issues"},"author":{"name":"Babear","email":"huynq1175@gmail.com","url":"https://github.com/huynq1175"},"license":"MIT","homepage":"https://github.com/huynq1175/react-native-splash-screen#readme","keywords":["react-native","ios","android"],"repository":{"type":"git","url":"git+https://github.com/huynq1175/react-native-splash-screen.git"},"description":"A high-performance splash screen for React Native","maintainers":[{"name":"huynq1175","email":"huynq1175@gmail.com"}],"readme":"# @abeman/react-native-nitro-splash\n\nA high-performance splash screen for React Native, powered by [NitroModules](https://nitro.margelo.com/). Supports static storyboard/XML layouts and optional **Lottie animations**.\n\n## Features\n\n- Splash screen launches instantly with the app (before JS bundle loads)\n- Controllable from both **native** and **JavaScript**\n- Full-screen edge-to-edge display on iOS and Android\n- Optional **Lottie animation** support (auto-detected, zero config)\n- Smooth fade-out transition on hide\n- Single splash instance shared across native and JS\n\n## Requirements\n\n| Platform | Minimum Version |\n|----------|----------------|\n| iOS      | 13.0+          |\n| Android  | SDK 24+        |\n| React Native | 0.73+     |\n| react-native-nitro-modules | ^0.35.2 |\n\n## Installation\n\n```sh\nnpm install @abeman/react-native-nitro-splash react-native-nitro-modules\n```\n\n### iOS\n\n```sh\ncd ios && pod install\n```\n\n### Android\n\nNo additional steps — auto-linked via Gradle.\n\n### Optional: Lottie Animation Support\n\n```sh\nnpm install lottie-react-native\n```\n\nWhen `lottie-react-native` is installed, Lottie support is **automatically enabled** at build time — no additional configuration needed.\n\n## Setup\n\n### iOS Setup\n\n#### 1. Create `LaunchScreen.storyboard`\n\nDesign your static splash screen in Xcode. This is shown by iOS **before any code runs**.\n\n> **Tip:** If using Lottie, set the storyboard background color to match the first frame of your animation for a seamless transition.\n\n#### 2. Auto-show on launch (already configured)\n\nThe splash screen auto-shows via `+load` in `SplashScreenBridge.mm` — no AppDelegate code needed.\n\nThe host app **does not** need to `import SplashScreen`. The ObjC bridge handles everything internally.\n\n#### 3. (Optional) Lottie animation\n\nAdd your Lottie JSON file to the Xcode project:\n1. Drag `splash_screen.json` into your app target in Xcode\n2. Ensure it's added to **\"Copy Bundle Resources\"** in Build Phases\n\nTo use a custom file name, add to `Info.plist`:\n```xml\n<key>SplashScreenAnimationName</key>\n<string>my_custom_animation</string>\n```\n\nControl animation playback via `Info.plist` (both optional):\n```xml\n<!-- Loop the animation (default: true). Set to false to play once. -->\n<key>SplashScreenLoop</key>\n<false/>\n\n<!-- When loop is false, delay hide() until the animation finishes (default: false). -->\n<key>SplashScreenWaitForAnimation</key>\n<true/>\n```\n\n> **Note:** Do NOT `import SplashScreen` in AppDelegate — C++ headers in NitroModules cause build failures. Use `Info.plist` for configuration instead.\n\n### Android Setup\n\n#### 1. Create `launch_screen.xml`\n\nCreate a layout file at `android/app/src/main/res/layout/launch_screen.xml`:\n\n```xml\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:gravity=\"center\"\n    android:orientation=\"vertical\"\n    android:background=\"#FFFFFF\">\n\n    <!-- Your splash content here -->\n    <TextView\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"My App\"\n        android:textSize=\"36sp\"\n        android:textStyle=\"bold\" />\n</LinearLayout>\n```\n\n#### 2. Suppress default Android splash\n\nAdd `windowIsTranslucent` to your app theme in `android/app/src/main/res/values/styles.xml`:\n\n```xml\n<style name=\"AppTheme\" parent=\"Theme.AppCompat.DayNight.NoActionBar\">\n    <item name=\"android:windowIsTranslucent\">true</item>\n</style>\n```\n\nThis prevents the default Android 12+ system splash from showing.\n\n#### 3. Show splash in MainActivity\n\n```kotlin\nimport android.os.Bundle\nimport com.margelo.nitro.splashscreen.SplashScreen\n\nclass MainActivity : ReactActivity() {\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        SplashScreen.show(this)\n        super.onCreate(savedInstanceState)\n    }\n\n    // ...\n}\n```\n\n#### 4. (Optional) Lottie animation\n\nPlace your Lottie JSON file at `android/app/src/main/res/raw/splash_screen.json`.\n\nTo use a custom file name, either call before `show()` in MainActivity:\n```kotlin\nSplashScreen.setAnimationName(\"my_custom_animation\")\nSplashScreen.show(this)\n```\n\nOr add meta-data to `AndroidManifest.xml` (no code change needed):\n```xml\n<application ...>\n    <meta-data\n        android:name=\"SplashScreenAnimationName\"\n        android:value=\"my_custom_animation\" />\n</application>\n```\n\nControl animation playback — via `AndroidManifest.xml` (both optional):\n```xml\n<application ...>\n    <!-- Loop the animation (default: true). Set to false to play once. -->\n    <meta-data android:name=\"SplashScreenLoop\" android:value=\"false\" />\n    <!-- When loop is false, delay hide() until the animation finishes (default: false). -->\n    <meta-data android:name=\"SplashScreenWaitForAnimation\" android:value=\"true\" />\n</application>\n```\n\nOr in code before `show()`:\n```kotlin\nSplashScreen.setLoop(false)\nSplashScreen.setWaitForAnimation(true)\nSplashScreen.show(this)\n```\n\n## Usage (JavaScript)\n\n```typescript\nimport SplashScreen from '@abeman/react-native-nitro-splash';\n\n// Hide the splash screen (e.g., after data loads)\nSplashScreen.hide();\n\n// Show the splash screen again\nSplashScreen.show();\n```\n\n### Typical pattern\n\n```typescript\nimport { useEffect } from 'react';\nimport SplashScreen from '@abeman/react-native-nitro-splash';\n\nexport default function App() {\n  useEffect(() => {\n    async function init() {\n      await loadMyAppConfigs();\n      SplashScreen.hide();\n    }\n    init();\n  }, []);\n\n  return <MyApp />;\n}\n```\n\n## API\n\n| Method | Description |\n|--------|-------------|\n| `SplashScreen.show()` | Show the splash screen. Callable from both JS and native. |\n| `SplashScreen.hide()` | Hide the splash screen with a fade-out animation. |\n\nBoth methods control a **single shared splash instance** across the entire app.\n\n## How It Works\n\n### iOS Flow\n\n```\n1. +load (SplashScreenBridge.mm)\n   └─ dispatch_async(main_queue) → autoShow()\n2. autoShow()\n   └─ Wait for UIWindowScene → showWithScene()\n3. showWithScene()\n   ├─ Lottie JSON found? → LottieAnimationView as root VC\n   └─ No Lottie?         → LaunchScreen.storyboard VC\n   └─ Create UIWindow (level: statusBar + 1) → makeKeyAndVisible\n4. hide()\n   └─ Stop Lottie → fade out 0.25s → remove window\n```\n\n### Android Flow\n\n```\n1. MainActivity.onCreate()\n   └─ SplashScreen.show(activity)\n2. showDialog()\n   ├─ Inflate launch_screen.xml into FrameLayout\n   ├─ Lottie raw resource found? → Add LottieAnimationView overlay (via reflection)\n   └─ Show full-screen Dialog (edge-to-edge, transparent system bars)\n3. hide()\n   └─ Cancel Lottie → fade out 250ms → dismiss dialog\n```\n\n## Lottie Support Details\n\nLottie is a **completely optional** dependency. The detection happens automatically at build time:\n\n| | With `lottie-react-native` | Without |\n|---|---|---|\n| **iOS** | Podspec detects via Node resolve → adds `lottie-ios` dependency + `-DLOTTIE_INSTALLED` flag | Static storyboard only |\n| **Android** | Lottie classes loaded via reflection at runtime | Static XML layout only |\n| **Bundle size** | +~1.5MB (iOS), +~300KB (Android) | No overhead |\n\n### Animation file lookup\n\n| Platform | Location | Naming |\n|----------|----------|--------|\n| iOS | App bundle (Copy Bundle Resources) | `{animationName}.json` |\n| Android | `res/raw/` | `{animationName}.json` |\n\nDefault `animationName` is `\"splash_screen\"`. Override with `setAnimationName()` before showing.\n\n## Architecture\n\nThis library uses [NitroModules](https://nitro.margelo.com/) HybridObject for the JS-native bridge. The native implementation follows the **ObjC-Compatible Bridge** pattern required for NitroModules on iOS:\n\n```\n┌─────────────────────────────────────────────┐\n│  JavaScript                                 │\n│  SplashScreen.show() / .hide()              │\n└──────────────┬──────────────────────────────┘\n               │ NitroModules HybridObject\n┌──────────────▼──────────────────────────────┐\n│  Native                                     │\n│  ┌─────────────────┐  ┌──────────────────┐  │\n│  │ SplashScreen.kt │  │ SplashScreen.swift│  │\n│  │ (HybridObject)  │  │ (HybridObject)   │  │\n│  └────────┬────────┘  └────────┬─────────┘  │\n│           │                    │             │\n│  ┌────────▼────────┐  ┌───────▼──────────┐  │\n│  │ Dialog + Layout  │  │ UIWindow + VC    │  │\n│  │ + LottieHelper   │  │ + Lottie (opt)   │  │\n│  └─────────────────┘  └──────────────────┘  │\n└─────────────────────────────────────────────┘\n```\n\n> **Why the ObjC Bridge?** `SplashScreen` inherits from `HybridSplashScreenSpec` (a C++ class), making it invisible to the Objective-C runtime. `SplashScreenBridge` (an `NSObject` subclass) wraps the static API so `+load` and native callers can access it without importing C++ headers. See [CLAUDE.md](./CLAUDE.md) for details.\n\n## Troubleshooting\n\n### iOS: `'HybridObjectPrototype.hpp' file not found`\n\nThis happens when the host app tries to import the SplashScreen module directly. The C++ headers in NitroModules are not compatible with the Clang dependency scanner.\n\n**Fix:** Never `import SplashScreen` in AppDelegate. The `+load` auto-show mechanism handles everything. If you need native access, use `SplashScreenBridge` via `NSClassFromString`.\n\n### Android: `Platform declaration clash` (JVM signature)\n\nNitroModules generates `abstract fun show()` / `abstract fun hide()`. If your companion object also has methods with the same name, JVM can't distinguish them.\n\n**Fix:** Use distinct names for companion methods (e.g., `showSplash()` / `hideSplash()`).\n\n### Android: `Type defined multiple times` (Lottie codegen)\n\nReact Native's codegen plugin generates `LottieAnimationViewManagerDelegate` in both the splash screen module and `lottie-react-native`.\n\n**Fix:** The `build.gradle` excludes Lottie codegen classes from this module's output:\n```gradle\nafterEvaluate {\n  tasks.withType(JavaCompile).configureEach { task ->\n    task.exclude(\"com/facebook/react/viewmanagers/LottieAnimation*\")\n  }\n}\n```\n\n### Android: Default system splash still shows\n\nAndroid 12+ shows a system splash screen before your Activity starts.\n\n**Fix:** Add `android:windowIsTranslucent=true` to your app theme to suppress it entirely.\n\n### iOS: Storyboard flashes before Lottie animation\n\niOS always shows `LaunchScreen.storyboard` before any code runs. This is a platform limitation.\n\n**Fix:** Set the storyboard background color to match the Lottie animation's first frame. The transition becomes imperceptible.\n\n## License\n\nMIT\n\n---\n\nMade with [NitroModules](https://nitro.margelo.com/)\n","readmeFilename":"README.md"}