Help get this topic noticed by sharing it on Twitter, Facebook, or email.

Timout to main menu in case of inactivity - ionic application

Hi, I am trying to setup a tmeout after inactivity to the main menu in Ionic application. I set the following code :
in the index init function:
setInterval($scope.indexIdleTimerFunction, 60000);

indexIdleTimerFunction()
{
$scope.indexIdleTimer++;
console.log("Timer:"+ $scope.indexIdleTimer);
if ($scope.indexIdleTimer>5) //5mins no activity
{
$scope.indexIdleTimer=0;
Apperyio.navigateTo("MainMenu");
}
}

The timer logs correctly however no navigation is executed.
Also tried to setup the same idleTimer function in each page but same effect.

What is the best practice here?
Thanks!
1 person has
this problem
+1
Reply