won't work Ionic 5 - angular 9
See original GitHub issueHi i’m trying to make this work
this.backgroundMode.enable()
this.backgroundMode.on('activate').subscribe(() => { this.splashScreen.show() })
this.backgroundMode.on('deactivate').subscribe(() => { this.splashScreen.hide() })
but when I install this on the phone it doesn’t work, its like the code runs when the app comes on foreground so it shows the splash screen when gets back on foreground and disappears after a few seconds, but i need to show the splash screen when the app its on the background. Thanks i hope someone can help me 😃
Ionic:
Ionic CLI : 6.9.1 (/Users/juand.lopez/.nvm/versions/node/v10.16.0/lib/node_modules/@ionic/cli) Ionic Framework : @ionic/angular 5.0.0-rc.5 @angular-devkit/build-angular : 0.900.5 @angular-devkit/schematics : 9.0.5 @angular/cli : 9.0.5 @ionic/angular-toolkit : 2.0.0
Cordova:
Cordova CLI : 9.0.0 (cordova-lib@9.0.1) Cordova Platforms : android 8.1.0, ios 5.1.1 Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 22 other plugins)
Utility:
cordova-res (update available: 0.15.1) : 0.6.0 native-run (update available: 1.0.0) : 0.2.8
System:
Android SDK Tools : 26.1.1 (/Users/juand.lopez/Library/Android/sdk) ios-deploy : 1.9.4 ios-sim : 8.0.2 NodeJS : v10.16.0 (/Users/juand.lopez/.nvm/versions/node/v10.16.0/bin/node) npm : 6.14.5 OS : macOS Catalina Xcode : Xcode 11.5 Build version 11E608c
Issue Analytics
- State:
- Created 3 years ago
- Comments:10
Top GitHub Comments
Could you try: https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/
The problem with that plugin “https://bitbucket.org/TheBosZ/cordova-plugin-run-in-background/src/master/” is when I put “cordova.plugins.backgroundMode.enable ();” in the code I have an error of: “Property ‘backgroundMode’ does not exist on type ‘CordovaPlugins’.”
Thank you