0

This is an old topic and I have never found an answer. This thread is the latest:

Phonegap: force an app to quit instead of running in background

But it is not a solution either as what I heard was "there is no way and it is not a good experience", etc...

However, if you download OfferUp app. Try to login and logout. The app on iOS will shut itself down. How do they do that? Obviously there is a way and it is approved by App Store. I am wondering if it is still possible with Cordova app?

Community
  • 1
  • 1
HP.
  • 19,226
  • 53
  • 154
  • 253
  • did you try `navigator.app.exitApp();` ? – Mudasser Ajaz Sep 01 '15 at 08:38
  • as far as i know, ios does not allow forced exit. It will be supported on android. – Mudasser Ajaz Sep 01 '15 at 08:40
  • `navigator.app.exitApp()` has been used and it doesn't work any more. iOS does allow forced exist. That's why I asked because many apps including OfferUp does it. – HP. Sep 02 '15 at 02:20
  • apple doesn't allow forced exits, they might not see it when they reviewed OfferUp app – jcesarmobile Sep 08 '15 at 11:54
  • Then what is the option for logout UX? There is no way I can clear all variables and init to original stage. Huge amount of work. My alternative is to do some dark layout screen and the app basically won't take any more touch input. – HP. Sep 10 '15 at 01:06
  • Have you seen this post? Don't know if this will help: http://stackoverflow.com/questions/14422908/iphone-does-not-recognize-phonegaps-navigator-app – ModusPwnens Jun 15 '16 at 15:43

1 Answers1

0

use this plugin

cordova plugin add https://github.com/FRD49/iOS-ExitApp.git

and simply call

navigator.app.exitApp();
user3808923
  • 49
  • 1
  • 5