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

User never goes idle in cordova #47

Closed
riaan53 opened this issue Dec 17, 2014 · 8 comments · Fixed by #64
Closed

User never goes idle in cordova #47

riaan53 opened this issue Dec 17, 2014 · 8 comments · Fixed by #64

Comments

@riaan53
Copy link

riaan53 commented Dec 17, 2014

Hi,

Im using this package with meteor (v1.0.1) Cordova on iOS. It works 100% on browser and on mobile browser - but when in Cordova the user never goes idle. Any ideas?

Thanks.

Regards,
Riaan

@mizzao
Copy link
Collaborator

mizzao commented Dec 18, 2014

I have never used it with Cordova, but I imagine there probably wouldn't be any blur inactivity, only timeouts. Not sure what is missing, but if you decide to do some tests, let me know what you find.

@riaan53
Copy link
Author

riaan53 commented Dec 19, 2014

Hi,

Ok cool. Will have a look later and let you know what I find!

Riaan

On Thursday, December 18, 2014, Andrew Mao notifications@github.com wrote:

I have never used it with Cordova, but I imagine there probably wouldn't
be any blur inactivity, only timeouts. Not sure what is missing, but if
you decide to do some tests, let me know what you find.


Reply to this email directly or view it on GitHub
#47 (comment)
.

Riaan Jacobs
riaan53@gmail.com

@mizzao
Copy link
Collaborator

mizzao commented Feb 18, 2015

Did you ever find anything on this? One way to test may be to fork the package and do some logging on the client side, just to see if the inactivity event is actually being sent to the server.

@KristerV
Copy link
Contributor

So I've tested this.

Currently user-status only detects online-offline activity (offline only happens with timeout).

To implement idle user-status would just need to use

document.addEventListener("pause", function() {
    // is idle
});

document.addEventListener("resume", function() {
    // is not idle
});

I've tested this in my app and it works great. When (for example) the home key is pressed, the "pause" event is fired. There is also an "offline" event, but I couldn't figure out when that is fired.

I'm currently trying to PR this.

@KristerV
Copy link
Contributor

tested and works. HOWEVER when user goes idle by "pause" then latestActivity gets "Invalid Date" because mizzao:timesync just isn't handling cordova somehow. Tracing this now.

@KristerV
Copy link
Contributor

ah couldn't figure it out... for some reason HTTP.get() just doesn't get to the server (no error is returned either). Looks like an issue with the HTTP package, i'm out of ideas.

@KristerV
Copy link
Contributor

Ok, got the timesync issue fixed, PR here Meteor-Community-Packages/meteor-timesync#26

@mizzao mizzao closed this as completed in #64 Jul 8, 2015
mizzao added a commit that referenced this issue Jul 8, 2015
@mizzao
Copy link
Collaborator

mizzao commented Jul 8, 2015

This should be fixed, please try out v0.6.5 in your apps.

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

Successfully merging a pull request may close this issue.

3 participants