Android platform pause and resume events do not fire.
See original GitHub issueDescription of the problem: The platform pause and resume events do not fire. If I build the project using Cordova it works as expected.
constructor(private platform: Platform) {
platform.ready().then(() => {
this.onPauseSubscription = this.platform.pause.subscribe(() => {
// Does not get here
});
this.onResumeSubscription = this.platform.resume.subscribe(() => {
// Does not get here
});
});
}
Affected platform
- [*] Android
- iOS
- electron
- web
OS of the development machine
- [*] Windows
- macOS
- linux
Other information:
Capacitor version: 1.0.0-beta.19
node version: v10.7.0
npm version: 6.1.0
CocoaPods version: N/A
Steps to reproduce: Run app on device. Put app into background by minimizing app or locking device Console.logs in the pause or resume events do not fire
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
On Android, platform.resume and .pause events fire as soon ...
The logs will show that right after “doCall” is called the resume and pause events are triggered, at the moment the phone dialer...
Read more >"pause" and "resume" events are not executing on Android
I determined a workaround to this problem. Although "pause" and "resume" are not fired on Android, the "visibilitychange" event is triggered ...
Read more >Platform Pause / Resume events not firing in Capacitor
I was trying to use these events for my autologout timer functionality however I now realise that these events are not available yet...
Read more >Cordova: Pause and Resume event not firing | Our Code World
In this article we are going to show the 3 steps that you're passing by and are probably causing your app to not...
Read more >pause - Apache Cordova
The pause event fires when the native platform puts the application into the background, typically when the user switches to a different application....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Platform is from
@ionic/angular
, it listen for Cordova pause and resume events, which were not implemented on Capacitor.I’ve added them now for better compatibility
FYI:
"Ionic Native is supported in Capacitor. Currently, Ionic Native contains only Cordova plugins, so whenever you find an Ionic Native wrapper you’d like to use, install it and then install the corresponding Cordova plugin by running
npm install your-cordova-plugin npx cap update"
https://capacitor.ionicframework.com/docs/getting-started/with-ionic/