@WLHY wrote:
this.platform.backButton.subscribe(() => { if (this.router.url === '/home') { if (click_times === 0) { this.toastService.info('click again to exit app'); click_times++; setTimeout(() => { click_times--; }, 2000); } else { try { navigator['app'].exipApp(); } catch (e) { console.log(e); } } } else { this.goBackService.goBack(); } });
Ionic version:4.11.0
Cordova version:9.0.0Error Info: TypeError: navigator.app.exipApp is not a function
I use
chrome://inspect/#devices
to debug it,and find that at first time do the actionnavigator['app'].exipApp()
,it has no error ,but nothing happend.
And when I donavigator['app'].exipApp()
again ,the code catch error ‘TypeError: navigator.app.exipApp is not a function’.
Why?
Posts: 1
Participants: 1