You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Very nice library. Thanks for putting it together.
My use case is for mobile devices. I want the JS fire events up on:
Browser app close (home button press)
Open a new tab in the browser
Device put to sleep (sleep button press)
On iOS Safari and Android Chrome all works well. I receive correct blur events for each case.
But on Android native browser (for older devices e.g. Samsung S4 etc.) device sleep does not fire any event.
Any ideas? Suggestions?
Cheers,
Doruk
Ps. In my use case I try to detect these events and kill a socket connection manually. This is why I need the device sleep as well.
The text was updated successfully, but these errors were encountered:
it's probably way too late for this response but I'll try to answer anyways. ifvisible works on top of browser provided visibility api. As you can see on caniuse.com browser support is limited in some cases. for older Android browsers it says to use webkit prefix and ifvisible already does this.
Plus ifvisible has a polyfill in place for older browsers, but it piggybacks on top of page blur, page focus events and those are only available on desktop browsers I think.
So if it's not working on the native browser, it's quite possible that the browser does not trigger these events on device sleep. And to my current knowledge, there is not much option to get that working.
Hi Serkan,
Indeed it was some time ago. No worries :)
Ifvisible.js solved many of the use cases on iOS and Android. For those browsers that does not work properly, I implemented a timer logic.
I used Tock.js for that. So if the user is away for a certain time it triggers an event. And you can build your application logic around this.
Thanks for the library and thanks for the reply.
Cheers,
Doruk
Hello,
Very nice library. Thanks for putting it together.
My use case is for mobile devices. I want the JS fire events up on:
On iOS Safari and Android Chrome all works well. I receive correct
blur
events for each case.But on Android native browser (for older devices e.g. Samsung S4 etc.) device sleep does not fire any event.
Any ideas? Suggestions?
Cheers,
Doruk
Ps. In my use case I try to detect these events and kill a socket connection manually. This is why I need the device sleep as well.
The text was updated successfully, but these errors were encountered: