Lottie splash screen plugin for capacitor
npm install @morphood/capacitor-lottie-splash-screenLottie splash screen plugin for capacitor
``bash`
npm install @morphood/capacitor-lottie-splash-screen
npx cap sync
Add to capacitor.config.ts or capcitor.config.json``
CapacitorLottieSplashScreen: {
Enabled: true,
LottieAnimationLocation: "public/[web/path/to.json]"
}
if you were previously using Capacitor Splash Screen set the following in you capacitor config
``
SplashScreen: {
launchAutoHide: true,
launchShowDuration: 0,
},
* echo(...)
* appLoaded()
* isAnimating()
* addListener('onAnimationEnd', ...)
* Interfaces
`typescript`
echo(options: { value: string; }) => Promise<{ value: string; }>
| Param | Type |
| ------------- | ------------------------------- |
| options | { value: string; } |
Returns: Promise<{ value: string; }>
--------------------
`typescript`
appLoaded() => Promise
Indicate to the plugin that the app has loaded.
Run as early as possible when your app is loaded.
This will ensure that on animation end the layer of the splash screen is removed
and touch interactions will go to the app.
Returns: Promise<any>
--------------------
`typescript`
isAnimating() => Promise<{ isAnimating: boolean; }>
Returns: Promise<{ isAnimating: boolean; }>
--------------------
`typescript`
addListener(eventName: 'onAnimationEnd', listenerFunc: () => void) => Promise
| Param | Type |
| ------------------ | ----------------------------- |
| eventName | 'onAnimationEnd' |
| listenerFunc | () => void |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
--------------------
#### PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove` | () => Promise<void> |