splashscreen for React Native.
First, cd
to your RN project directory, and install RNMK through rnpm . If you don't have rnpm, you can install RNMK from npm with the command npm i -S rnkit-splash-screen
and link it manually (see below).
-
rnpm install [email protected]
-
$npm install -S rnkit-splash-screen
$react-native link rnkit-splash-screen
- Add
node_modules/rnkit-splash-screen/ios/RNKitSplashScreen.xcodeproj
to your xcode project, usually under theLibraries
group - Add
libRNKitSplashScreen.a
(fromProducts
underRNKitSplashScreen.xcodeproj
) to build target'sLinked Frameworks and Libraries
list - Add ocr framework to
$(PROJECT_DIR)/Frameworks.
-
rnpm install [email protected]
-
$npm install -S rnkit-splash-screen
$react-native link rnkit-splash-screen
- JDK 7+ is required
- Add the following snippet to your
android/settings.gradle
:
include ':rnkit-splash-screen'
project(':rnkit-splash-screen').projectDir = new File(rootProject.projectDir, '../node_modules/rnkit-splash-screen/android/app')
- Declare the dependency in your
android/app/build.gradle
dependencies {
...
compile project(':rnkit-splash-screen')
}
- Import
import io.rnkit.splashscreen.SplashScreenPackage;
and register it in yourMainActivity
(or equivalent, RN >= 0.32 MainApplication.java):
@Override
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new SplashScreenPackage(MainActivity.activity, true)
);
}
Finally, you're good to go, feel free to require rnkit-splash-screen
in your JS files.
Have fun! 🤘
Import library
import RNKitSplashScreenManager from 'rnkit-splash-screen'
RNKitSplashScreenManager.tipText('text')
progress 0.0 .. 1.0, default is 0.0. values outside are pinned.
RNKitSplashScreenManager.progress(progress)
RNKitSplashScreenManager.open()
RNKitSplashScreenManager.close({animationType: RNKitSplashScreenManager.animationType.scale, duration: 850, delay: 500})
- @simamn The main author.
@cyqresig - react-native-smart-splash-screen
Feel free to contact me or create an issue
made with ♥