Hi, I haven't complete the iOS one, but I hope my Android case helps you.
I will try to update this comment after I complete the iOS one.
For my case (RN 0.61) in Android, it seems like the library messes up my MainActivity.java so I just discard the changes made to it and it worked.
The the library adds:
import android.os.Bundle;
import org.devio.rn.splashscreen.SplashScreen;
...
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashScreenTheme); anything_that_exists_here();
super.onCreate(savedInstanceState);
SplashScreen.show(this, R.style.SplashScreenTheme); }
to the android/app/src/main/java/com/project_name/MainActivity.java
-
import android.os.Bundle and import org.devio.rn.splashscreen.SplashScreen are already there for my case, but since they are not the 1st and 2nd imports, the library forcefully adding the imports made it double imports. This is not the reason it didn't work though.
-
The real culprit is that SplashScreen.show(this, R.style.SplashScreenTheme); is added after the anything_you_had_here(); \n super.onCreate(savedInstanceState);. So yeah, there is a bug in this library that the line adding is messed up.
I don't have the time to do a PR for the moment but I hope this helps @yleflour track down the bug both on the Android and iOS (if present) side and fix it. Good luck guys!
===
For completeness, you just need:
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashScreenTheme);
super.onCreate(savedInstanceState);
}
Once you do this, then the library will detect SplashScreen.show(this, R.style.SplashScreenTheme); successfully next time so you won't ever have to manually do this again.
Hi, I haven't complete the iOS one, but I hope my Android case helps you.
I will try to update this comment after I complete the iOS one.
For my case (RN 0.61) in Android, it seems like the library messes up my MainActivity.java so I just discard the changes made to it and it worked.
The the library adds:
to the
android/app/src/main/java/com/project_name/MainActivity.javaimport android.os.Bundleandimport org.devio.rn.splashscreen.SplashScreenare already there for my case, but since they are not the 1st and 2nd imports, the library forcefully adding the imports made it double imports. This is not the reason it didn't work though.The real culprit is that
SplashScreen.show(this, R.style.SplashScreenTheme);is added after theanything_you_had_here(); \n super.onCreate(savedInstanceState);. So yeah, there is a bug in this library that the line adding is messed up.I don't have the time to do a PR for the moment but I hope this helps @yleflour track down the bug both on the Android and iOS (if present) side and fix it. Good luck guys!
===
For completeness, you just need:
Once you do this, then the library will detect
SplashScreen.show(this, R.style.SplashScreenTheme);successfully next time so you won't ever have to manually do this again.