Ionic.Platform.exitApp() is not working in iOS

I am trying to send the app to backgroud / close the app (either of them) using ionic.Platform.exitApp(). This works in Android but doesnt work in iOS. Please advise URGENTLY.

Thanks

My understanding on iOS is that exiting the App is not possible / allowed. I think if your App does exit it will be failed by the Apple guys during approval of your App.

As for backgrounding the App on iOS I’m not sure if it’s a violation but I couldn’t find a method to do it either.

I just want to move the app to the background saying that the app is not available at the moment (based on certain conditional logic in the app). If we cannot kill it, atleast, we need to move it to the background.

so basically ionic.platform.exitapp() doesnt work - is my understanding correct?

Try navigator.app.exitApp() .

Hi,

This doesnt work for iOS. :frowning:

I thing on iOS, you can’t ‘exit’ an app. The user should simple press the home
button, then he can fire up apps. The running app is automatically canceled after a while of inactivity.

Anyone who can help here?

It’s technically not possible to kill or background an app in iOS. (Or do you know of any other app that does this?)

What you could do is show a fullscreen view with no links out that tells your user that your app is not available right now and he should please go somewhere else or close the app, if your requirements are met.

You can use cordova’s “pause” or “resume” events and ionic also provides service on handling events.
see here: http://ionicframework.com/docs/api/service/$ionicGesture/

https://cordova.apache.org/docs/en/latest/cordova/events/events.pause.html