Software Archive
Read-only legacy content
17061 Discussions

Exit from App (Working on Android devices only)

Rodrigo_M_1
New Contributor II
477 Views

Hi there,

I'm trying to figure out how to exit from the application on iOS ...

I have the follow code that's works fine on Android devices, but on iOS not!

<html>
  <head>
  <title>PhoneGap</title>

    <script type="text/javascript" src="cordova.js"></script>      
    <script type="text/javascript"">

        function onLoad()
        {
              document.addEventListener("deviceready", onDeviceReady, true);
        }

        function exitFromApp()
         {
            navigator.app.exitApp();
         }

    </script>
</head>
<body onload="onLoad();">
   <button name="buttonClick" onclick="exitFromApp()">Click Me!</button>
  </body>
</html>

 

0 Kudos
1 Solution
Elroy_A_Intel
Employee
477 Views

There is no API provided fopr gracefully terminating an iOS application.

In iOS, the user is expected to press the Home button to close applications.

View solution in original post

0 Kudos
1 Reply
Elroy_A_Intel
Employee
478 Views

There is no API provided fopr gracefully terminating an iOS application.

In iOS, the user is expected to press the Home button to close applications.

0 Kudos
Reply