Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:03:17+00:00 2026-05-30T01:03:17+00:00

I am using phonegap to develop one of my iPhone app. In the index.html

  • 0

I am using phonegap to develop one of my iPhone app. In the index.html page I am implementing a small javascript code just to check if the Internet is available or not inside the onBodyLoad() function as below:

function onBodyLoad() {                                       
    if (!navigator.onLine) {   
         alert('offline');     
    }

    document.addEventListener("deviceready",onDeviceReady,false);
    //alert("here!");   
}

This just work fine but I want to exit from the application when user taps the “Ok” button of that alert message.

I tried the add navigator.device.exitApp() after the alert but did not work.

How can I exit from the application after tapping the “OK” button from the alert message?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:03:20+00:00Added an answer on May 30, 2026 at 1:03 am

    navigator.device.exitApp() is not supported on iOS as Apple is pretty down on apps closing themselves.

    It is possible I believe by setting the UIApplicationExitsOnSuspend boolean to YES in your applications info plist (in a PhoneGap application this is in Supporting Files -> -info.plist).

    See:

    https://developer.apple.com/library/ios/#DOCUMENTATION/iPhone/Conceptual/iPhoneOSProgrammingGuide/ManagingYourApplicationsFlow/ManagingYourApplicationsFlow.html

    Specifically: “Opting out of Background Execution”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm planning to develop web app using html.(using html tool like phonegap). I want
I have a mobile app that I developed using PhoneGap (and html/css/javascript) and there
I am trying to develop an iPhone app using PhoneGap and jQuery Mobile. This
I'm using PhoneGap to develop a Windows Phone 7 app. I'm trying to call
I am using phonegap and sqlite to develop cross-platform mobile app for android,ios,blackberry.For reference
I am using Phonegap 1.3.0, and want to develop an app which uses local
I develop an app using PhoneGap. I got a service which is in background
Guys I have this peace of code I'm using phonegap with jqueryMobile to develop
I'm developing an iphone app using PhoneGap 1.2.0 with Snow Leopard, Xcode 4.2 &
I'm using phonegap to develop an android app and I would like to fix

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.