Software Archive
Read-only legacy content
17061 Discussions

How to show Phone Setting?

xkevin
New Contributor I
265 Views

On my ajax call, I am trying to handle an error. If error status is 0 or not connected to internet, Dialog box should appear directing the user to phone setting to enable wifi or data mobile. How I could do this on andriod and IOS?

I am also looking code where in I can exit my app when I pressed back button. Thank you for any help.

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
265 Views

"Exiting" your app is not something most platforms support. It cannot be done, programmatically, on iOS and is discouraged on Android. I recommend you allow the mobile deal with the management of your app's lifecycle and not worry about "exiting" your app. You might see this SO post regarding the Android exit feature > http://stackoverflow.com/questions/35144829/phonegap-navigator-app-exitapp-not-working <

There is a core Cordova plugin called Network Information that can help you determine the network status, I recommend you start there. Other more sophisticated methods are available. Search for the Internet for "network status Cordova application" for more help.

View solution in original post

0 Kudos
1 Reply
PaulF_IntelCorp
Employee
266 Views

"Exiting" your app is not something most platforms support. It cannot be done, programmatically, on iOS and is discouraged on Android. I recommend you allow the mobile deal with the management of your app's lifecycle and not worry about "exiting" your app. You might see this SO post regarding the Android exit feature > http://stackoverflow.com/questions/35144829/phonegap-navigator-app-exitapp-not-working <

There is a core Cordova plugin called Network Information that can help you determine the network status, I recommend you start there. Other more sophisticated methods are available. Search for the Internet for "network status Cordova application" for more help.

0 Kudos
Reply