I've build an Ionic2 app and using
this.platform.exitApp()
in app.component.ts to exit app.
On Android it's work well, but got this error on iOS
undefined is not an object (evaluating 'e.navigator.app.exitApp')
App. exitApp(); Force exit the app. This should only be used in conjunction with the backButton handler for Android to exit the app when navigation is complete.
We use the Navigator interface to call the exitApp() method and exit the app. Please Note: The subscribe() method will return the subscription, which is in turn stored in a class property backButtonSubscription that we declare.
On the iPhone there is no concept of quitting an app. The only action that should cause an app to quit is pressing the Home button on the phone, and that's not something developers have access to.
According to Apple, your app should not terminate on its own. Please check this link
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With