From 24f815f3785ff50013cdd4d1fdc0e946a1a1194f Mon Sep 17 00:00:00 2001 From: Surya Kaushik <41267674+suryakaushik@users.noreply.github.com> Date: Tue, 5 Apr 2022 02:09:40 +0530 Subject: [PATCH] Added support for RN0.68.0 --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 9eb674f9..fad1c8ad 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,31 @@ public class MainActivity extends ReactActivity { } ``` +**Android: (For RN >=0.68.0)** + +Update the `MainActivity.java` to use `react-native-splash-screen` via the following changes: + +```java +import com.facebook.react.ReactActivity; +import com.facebook.react.ReactActivityDelegate; +import com.facebook.react.ReactRootView; + +// react-native-splash-screen >= 0.3.1 +import org.devio.rn.splashscreen.SplashScreen; // here +// react-native-splash-screen < 0.3.1 +import com.cboy.rn.splashscreen.SplashScreen; // here + +public class MainActivity extends ReactActivity { + // ...other code + @Override + protected ReactActivityDelegate createReactActivityDelegate() { + SplashScreen.show(this, R.style.SplashScreenTheme, true); // here + return new MainActivityDelegate(this, getMainComponentName()); + } + // ...other code +} +``` + **iOS:** Update `AppDelegate.m` with the following additions: