Repository URL to install this package:
Here the list of the available configuration attributes fot the Splash Screen Plugin:
Name | Default | Platform | Mandatory | Description |
---|---|---|---|---|
desplash.enabled | true |
Android/iOS | No | Enable/Disable the Splash Screen |
desplash.backgroundColor | #ffffff |
Android/iOS | No | The splash screen background color |
desplash.transition.fade.duration | 0.4 | Android/iOS | No | Fade in/out transition duration |
desplash.destroyOnHide | true |
Android/iOS | No | Destropy automatically the Splash Screen on hide |
desplash.autoHide | true |
Android/iOS | No | Hide automatically the Splash Screen when the main page is ready |
desplash.resourceName | null |
Android/iOS | No | Set the image resource name |
desplash.ios.useStoryboard | true |
iOS | No | Set the Storyboard usage for the Splash Screen UI |
desplash.ios.storyboard | default |
iOS | No | Set the Storyboard name used for the Splash Screen UI (by default use the same used by Xcode for the native splash) |
clobber: DynamicEngine.plugins.Splashscreen
hideSplash(successFn,errorFn) Hide the splash
showSplash(successFn,errorFn) Show the splash
destroySplash(successFn,errorFn) Destroy the splash (free native memory)
For use the default implementation, set desplash.resourceName with the name of your drawable asset (implementation load automatically the best drawable for the screen res).
For create your custom splashScreen, you could set a custom splash screen provider implementation
DESplashScreenManager.getInstance(...).setSplashScreenProvider(myProvider);
myProvider must implement DESplashScreenProvider interface:
public interface DESplashScreenProvider {
/**
* Provide a splashScreen
* @return a splash screen instance
*/
DESplashScreen provideSplashScreen();
}
Add this import in your AppDelegate class:
#import "DESplashScreenManager.h"
Add the install method in your AppDelegate code:
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
...
self.viewController = [[MainViewController alloc] init];
[[DESplashScreenManager sharedInstance]installDefault:self.viewController];
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
Note: we suggest to use the Storyboard mechanism for the splash screen.
To add a custom UIVIew implementation for the splash you can provide the class to the DESplashScreenManager with the method:
- (void)installWithProvider:(id<DESplashScreenProvider>)splashProvider onViewController:(CDVViewController*)mainViewController
You need to implement a class with the protocol DESplashScreenProvider and return a UIView instance when required.