seems like you only exported hide method in SplashScreen.m but not show?
Yes, but you can use it in the following way:
Android
public class MainActivity extends ReactActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
+ SplashScreen.show(this); // here
super.onCreate(savedInstanceState);
}
// ...other code
}
iOS
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// ...other code
+ [SplashScreen show]; // here
return YES;
}
I would like to on app resume, show SplashScreen again until contents are loaded.
Is that possible? I'm detecting app resume in React Native Javascript
Can you export the show method, and then send a pull request?
public class MainActivity extends ReactActivity {
/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
SplashScreen.show(this,true);
}
}
I've downloaded and installed the splash screen plugin automatically. Now, I can see SplashScreen.xcodeproj in Libraries and libSplashScreen.a in "Link Binary With Libraries" section. But when I try #import "SplashScreen.h", it gives file not found error.

react-native link at the home directory of your project @sairasamdanii
I did same. And I can see "react-native-splash-screen" in node_modules of my project. Can you please notice that imports in my AppDelegate are like "#import
I've created my project through plain terminal commands and code written in it is the boiler code provided by react native itself.
@sairasamdanii Are you using v40 of React Native? The iOS native headers have been moved. See also https://github.com/facebook/react-native/releases/tag/v0.40.0 . Quote from that page: "This means that all iOS native libraries need a major version bump for RN 0.40."
Yeah it appears that the SplashScreen setup is broken after RN 0.40. I'm having the same issues.
@crazycodeboy show() looks like a function under api but it isn't...
@siemya show() is a native method
@crazycodeboy if show() is only a native method, then how can we show the Splash Screen at other times during the app experience?
I'm trying to show the splash screen during page transitions, for example. And it doesn't look like I can do this through react-native-splash-screen.
@crazycodeboy i also want to show the splash screen when i reload the js bundle, thats why i need a show function. 陌s there any other way to do it?
hide is undefined
@siemya @jdmcpeek @JakeRawr @crazycodeboy Any update on this? I'm using this with redux-persist and am having a issue #60 . any way to somehow treat the splash screen as a react component and render it at will? I thought about making a component using the same image as the splash screen, but not sure if aspect ratio and layout would match for devices of diff sizes.
@sairasamdanii
Please Go to build setting >> Header search path
add this line :
$(SRCROOT)/../node_modules/react-native-splash-screen/ios
Thanks.
we do need this feature
Most helpful comment
@crazycodeboy if show() is only a native method, then how can we show the Splash Screen at other times during the app experience?
I'm trying to show the splash screen during page transitions, for example. And it doesn't look like I can do this through react-native-splash-screen.