Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. Lakaroth
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    Lakaroth

    @Lakaroth

    0
    Reputation
    1
    Posts
    824
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Lakaroth Follow

    Posts made by Lakaroth

    • Instant app exit! Need confirmation how to do?

      Hello there, i’ve compiled my HTML5 game, everything’s ok.
      Engine: Rpg Maker MV.
      I just need a confirmation when user press quit button, because now is istantanely.
      I add Cordova Notification plugin (cordova dialog plugin)
      Then in my project i’ve create a JS file like this:

       document.addEventListener("backbutton", function (e) {
          e.preventDefault();
          navigator.notification.confirm("Are you sure want to exit from App?", onConfirmExit, "Confirmation", "Yes,No");
      }, false);
      
      
      function onConfirmExit(button) {
          if (button == 2) { //If User select a No, then return back;
              return;
          } else {
              navigator.app.exitApp(); // If user select a Yes, quit from the app.
          }
      }
      

      But it doesn’t work.

      I’ve also try to put in
      <script> JS CODE </script>
      On my Index.html
      And nothing…
      Where i’m wrong?
      Thanks

      posted in Monaca Tools
      Lakaroth