cancel
Showing results for 
Search instead for 
Did you mean: 

Close SAPUI5 Cordova web app

MariusStoica
Active Participant
0 Kudos

Hi guys,

I've been fiddling with a few Cordova apps and I found myself asking the question "How do I close the app ?".

I tried looking for some posts here, with no luck.

I tried also some "window.close" things in the Chrome console, with no success, and tried fiddling with "sap.ui.getCore()" commands (since I saw there some lock commands, and such).

Anyone has any idea on how to do this ?

Thank you in advance,

Marius

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor
0 Kudos

Hi Marius,

UI5 does not support this, cause it is a pure JS framework which does not know language specific commands to close the hybrid app.

Cordova had in older versions unofficial undocumented methods (e.g. navigator.app.appExit) which allowed to close the app programatically. But the default implementation did only support Android. iOS was not supported, because iOS does not allow to end an app programatically. For WP8 there was/is an own plugin (you can find it in the Cordova plugin library).

As far as I know the navigator.app.appExit method was removed in one of the last Cordova releases.

Just google for navigator.app.appExit and you will find several discussions about that topic.

Best regards,

Florian

MariusStoica
Active Participant
0 Kudos

Hi,

In my case "navigator.app.exitApp()" worked. Even though the Cordova container is still "alive" the app inside is closed, meaning when I try to open it again it goes from the start and it's not resumed.

I don't know if it's all I need or if it's enough, but thank you for your answer.

Marius

Answers (0)