0
votes

i have been recently trying on with Cordova Multi device hybrid apps, targeted for Windows phone 8.1. To add more to that, i add windows as the platform in the cordova project.

Now my question is, is there any way in which i can terminate my application in the user device, or even move it to background just to MIMIC the exit app feature in Windows phone 8.1 device, with or without using WinJS library ??

I am trying to capture the back click and in turn exit the app on back click.

Note that i am already capturing the back button click and handling navigation accordingly.

2
did you tried navigator.app.exitApp(); ?AtanuCSE
not working.. Tried both navigator.app.exitApp as well as navigator.device.exitApp();Manish Kr. Shukla
try this navigator.navigation.exitApp(); AtanuCSE
Unable to get property of exitApp of undefined. It doesn't show up navigation in the intellisense drop down of navigator in VS2013Manish Kr. Shukla

2 Answers

1
votes

I found that MSApp.terminateApp() works.

0
votes

Hell, It was just one line.

You can close your windows 8.1 apps using window.close();

Edit

Some of Microsoft engineers point out the mistake here: window.close() is not a safe way to implement the app, calling this method will break app suspend and resume also might lose data when user back to the app.

window.close() is only used to call when the app has reached an unrecoverable state.

More details can be found on this thread --> Exiting App, in A Cordova based multi device hybrid application