Closed mbakker96 closed 3 years ago
You are using the plugin wrong, check the docs.
You don't have to import the plugin directly from core, but the Plugins
object that contains all Capacitor plugins.
Replace import {SplashScreen} from '@capacitor/core';
with
import { Plugins } from '@capacitor/core';
const { SplashScreen } = Plugins;
This has been a common problem, probably related to vs code or other editors making auto imports from the wrong place.
Luckily in Capacitor 3 you'll be able to import the plugins directly instead of using the Plugins
object.
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.
Bug Report
Capacitor Version
Platform(s)
[ x ] iOS [ ] Android ? [ ] Web
Not tested on android
Current Behavior
I disabled the autohide function in the
capacitor.config.json
file because the splash screen most be visible until a resolve of an API response. To hide the splash screen I usedSplashscreen.hide()
(capacitor) andthis.splashscreen.hide
(ionic-native). By both the splash screen did not hide.Expected Behavior
When calling Splashscreen.hide, the splash screen should hide and the application should be visible.
Code Reproduction
https://github.com/mbakker96/splashscreen
Other Technical Details
npm --version
output: 6.14.6node --version
output: v10.22.0pod --version
output (iOS issues only): 1.9.3Additional Context
I only tested it on iOS and to mock an API request I used the timeout function. The example application is not my real application, but I have made a mock application to display the issue.