Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49164

Ionic BackButton

$
0
0

@anicacute09 wrote:

Hi guys, I am having a problem with my splashscreen... It is showing only for the first run so i decided to override the back button and exit the app using this code:

$ionicPlatform.registerBackButtonAction(function (event) {

  if ($state.current.name == "index") {
      var confirmPopup = $ionicPopup.confirm({
                    title: 'Confirm Exit',
                    template: "Are you sure you want to exit?"
                });
            confirmPopup.then(function (close) {
                if (close) {
                    // there is no back view, so close the app instead
                    navigator.app.exitApp();
                } // otherwise do nothing
                console.log("User canceled exit.");
            });

  }
  else {
       navigator.app.backHistory();
       }  }, 100);

I successfully exit the app but as I reopen it the problem still showing. The code only exit my app and goes to the background but not killing it. I want to kill my app in order when I reopen the app, The splash screen shows again. Thanks..

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49164

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>