Hello,
I am using ionic 5.4.16 and Capacitor.
I have a problem since the beginning with my application on Android :
- When I press the backbutton of my phone, the app is immediately closed
- The events are not trigger. See examples :
this.platform.ready().then(() => {
console.log('PLATFORM READY')
document.addEventListener("backbutton", () => {
this.routerOutlets.forEach(async(outlet: IonRouterOutlet) => {
console.log('BACKBUTTON')
});
});
this.platform.backButton.subscribeWithPriority(0, () => {
console.log('BACKBUTTON 2')
});
});
âPLATFORM READYâ is displayed when the app start but when I press the back button, âBACKBUTTONâ is not displayed, the app is closed.
When I press the button, I have theses logs :
2021-12-25 10:01:22.641 25687-25801/MYAPP I/GED: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 31, oppidx_max 31, oppidx_min 0
2021-12-25 10:01:22.720 25687-25687/MYAPP W/ContentCatcher: Failed to notify a WebView
2021-12-25 10:01:22.785 25687-25901/MYAPP I/GED: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 31, oppidx_max 31, oppidx_min 0
2021-12-25 10:01:22.795 25687-25801/MYAPP I/GED: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 31, oppidx_max 31, oppidx_min 0
2021-12-25 10:01:22.912 25687-25901/com MYAPP Failed to notify a WebView I/GED: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 31, oppidx_max 31, oppidx_min 0
2021-12-25 10:01:23.003 25687-25687/MYAPP W/Looper: Slow Looper main: doFrame is 314ms late because of 1 msg, msg 1 took 179ms (seq=1233 running=47ms runnable=8ms io=109ms late=108ms h=android.app.ActivityThread$H w=159)
Maybe âFailed to notify a WebViewâ is an idea ?
What am I doing wrong ? is there something specific to do in order to have this event ?
Thank you in advance