The My PhoneGap application should give the server a websocket message (to update the connection status) when the pause event is captured.
Android
There is no problem with the Android device using this piece of code:
document.addEventListener("deviceready",function(){
document.addEventListener("pause", function() {
socket.emit('changeStatus', 'incative');
});
document.addEventListener("resume", function() {
socket.emit('changeStatus', 'active');
});
}, false);
Ios
In iOS, this is another fish maker. Indeed, the official PhoneGap documentation of the pause event :
iOS Quirks
, Objective-C, , , , . , console.log( ) API PhoneGap. , ( ).
, ", Objective-C, ", ?
, iOS, "changeStatus" "" .
: phonegap iOs ""?