Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Automatic Logout Feature in Iphone app

Guest
Jun 12, 2016 Jun 12, 2016

I have attached a project using devextreme.  In that project,  I have implemented automatic logout feature.  But its work wrongly.  It automatically move to home page from view page, when device is inactive or active.  That means resetTimer is not working.  I have checked online.  But still I didn't get proper solution to that problem.

I have used following code.

function setup() {

        window.addEventListener("mousemove", resetTimer, false);

        window.addEventListener("mousedown", resetTimer, false);

        window.addEventListener("keypress", resetTimer, false);

        window.addEventListener("DOMMouseScroll", resetTimer, false);

        window.addEventListener("mousewheel", resetTimer, false);

        window.addEventListener("touchmove", resetTimer, false);

        window.addEventListener("MSPointerMove", resetTimer, false);

        startTimer();

    }

    function startTimer() {

       

        timeoutID = window.setTimeout(goInactive, 5000);

    }

    function resetTimer(e) {

        if (typeof timeoutID === "number") {

            if (Application5.app.navigationManager._currentItem.uri != 'home' && timeoutID) {

                window.clearTimeout(timeoutID);

                timeoutID = null;

                goActive();              

            }

        }      

    }

    function goActive() { 

        startTimer();

    }

    function goInactive() {

      Application5.app.navigate("home", { target: "current" });

    }

It have worked well in android mobile

133
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources
Help resources