Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Fine in Desktop , but not in Mobile Devices #9

Open
amul8612 opened this issue May 30, 2020 · 1 comment
Open

Working Fine in Desktop , but not in Mobile Devices #9

amul8612 opened this issue May 30, 2020 · 1 comment

Comments

@amul8612
Copy link

amul8612 commented May 30, 2020

i tried to check the idle timer in my webapp , it is working in Desktop but when i try to access the same in the mobile devices , the idle timer is not working .
Steps:
Log in to my web App in my mobile (Chrome Browser)
Push it to Background app
Lock my mobile device
Come back after 15 mins to check , if i see a modal about User Inactive.
Result: I could not see any dialog box. Is the timer is working ?.. Can u please help me

Here is my Code To check the Idle Timer :
const TouchDeviceIdle = new Idle()
.whenNot([
{
events: ['touchcancel','touchmove','touchstart','focus','focusin'],
target: document,
},
])
.whenNotInteractive()
.within(15)
.do(() => {
if(this.sessionModalShow){
TouchDeviceIdle.stop();
}else{
this.userInactive(TouchDeviceIdle);
}
})
.start(); */

@amul8612 amul8612 changed the title Working Fine in Desktop , but now in Mobile Devices Working Fine in Desktop , but not in Mobile Devices May 30, 2020
@harunurhan
Copy link
Owner

harunurhan commented Jun 1, 2020

@amul8612 That's probably because mobile OSes are pretty restrictive about which apps can work on the background, and what they can do.

So it's likely that mobile browser doesn't keep executing the webpage's code, when the app is on the background for various reasons, (obvious one is that it could drain the battery)

Although this can be worked around by saving the time before the mobile browser tab becomes inactive and checking how much time was spent inactive once the tab becomes active, I don't have time right now to dig into it and handle this specific case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants