Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot exit app with ionic2 on iOS? Is there a way to exit app?

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')
like image 542
Carry All Avatar asked Jul 19 '17 09:07

Carry All


People also ask

How to exit app in iOS ionic?

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.

How do I close apps in ionic 4?

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.


1 Answers

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

like image 163
Amal T S Avatar answered Oct 16 '22 23:10

Amal T S