Hi, I am trying to exit the phonegap application on IOS and Android. I have use below code : navigator.app.exitApp(); and navigator.device.exitApp(); but on them is working and get error like :TypeError: Result of expression 'navigator.device' [undefined] is not an object. at file:///android_asset/www/disclaimer.html:50
Is there ant straight forward solution to complete exit the phonegap app?
Is there ant straight forward solution to complete exit the phonegap app?
- 21 Posts
- 2 Reply Likes
Posted 8 years ago
- 1911 Posts
- 199 Reply Likes
You can use navigator.app.exitApp() - I believe that's supported on Android.
On iOS, Apple does not allow apps to programmatically exit.
On iOS, Apple does not allow apps to programmatically exit.
- 21 Posts
- 2 Reply Likes
Hi Andrew,
Thanks for quick reply.
I have already use the navigator.app.exitApp() - but it's give the undefined error on android.
is there any alternate solution?
Shail.
Thanks for quick reply.
I have already use the navigator.app.exitApp() - but it's give the undefined error on android.
is there any alternate solution?
Shail.
- 1911 Posts
- 199 Reply Likes
Are you sure deviceready has fired? And are you including phonegap.js on the page?
- 21 Posts
- 2 Reply Likes
Hi Andrew,
I have upgrade the phonegap version and problem solved.
Thanks a lot.
Shail.
I have upgrade the phonegap version and problem solved.
Thanks a lot.
Shail.
- 5 Posts
- 0 Reply Likes
hi shail what is the phonegap version do you use?
i use 2.1 with phonegap build and navigator.app.exitApp() not work in ios
thanks.
i use 2.1 with phonegap build and navigator.app.exitApp() not work in ios
thanks.
- 255 Posts
- 0 Reply Likes
navigator.app.exitApp() does not work on IOS, only Android. There is no way I know of to programmatically exit an IOS app. If someone does know...do tell :)
- 1 Post
- 0 Reply Likes
According to: http://stackoverflow.com/questions/35...
In ObjC:
exit(0)
or
[[NSThread mainThread] exit]
In ObjC:
exit(0)
or
[[NSThread mainThread] exit]
- 1 Post
- 1 Reply Like
i do it (:
-I was using a plugin screenshot (https://github.com/phonegap/phonegap-...)
-When this works well, modify the code (attached screenshots).
You modify Screenshot.m and Screenshot.h (add a simple method for close the app 'close(0);' )
create a javascript function
modify the Screenshot.js.
add the button to close you app
any question, contact me edades@gmail.com
greetings from chile =)
-I was using a plugin screenshot (https://github.com/phonegap/phonegap-...)
-When this works well, modify the code (attached screenshots).
You modify Screenshot.m and Screenshot.h (add a simple method for close the app 'close(0);' )
create a javascript function
modify the Screenshot.js.
add the button to close you app
any question, contact me edades@gmail.com
greetings from chile =)
- 1 Post
- 1 Reply Like
if(navigator.app){
navigator.app.exitApp();
}else if(navigator.device){
navigator.device.exitApp();
}- 1 Post
- 0 Reply Likes
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
On iOS, you don't 'exit' an app. The user should simple press the home button, so he can fire up other apps. The running app is automatically canceled after a while of inactivity.
- 1 Post
- 0 Reply Likes
I have used navigator.app.exitApp()
Its Quit does not actually quit the app from memory and it is still running as a background process
How do we kill background process ?
Its Quit does not actually quit the app from memory and it is still running as a background process
How do we kill background process ?
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
You don't.
In iOS, the Operating System will do so after a while. In Android, the user can do so in the Settings-App section.
In iOS, the Operating System will do so after a while. In Android, the user can do so in the Settings-App section.
- 1 Post
- 0 Reply Likes
I don't know why this command doen not work on intel XDK.
:(
:(
Petra V., Champion
- 7794 Posts
- 1391 Reply Likes
I don't know why you make that remark here, in a community about Phonegap Build, which you apparently don't use, anyway.
- 1 Post
- 0 Reply Likes
Maybe should tell him, instead of blame :)
Related Categories
-
PhoneGap Build
- 15111 Conversations
- 275 Followers











Red2678
Andrew Lunny
Ivan Gonzalez
rohil patel