Good morning
I was using signalr to update an application in which vehicles are shown moving on a map, the locations are notified from the server to the page by signalr, while the page is active, in the browser of the device (it is not a Hybrid application), all right, but if I send the browser to the background, regardless of whether it is Android or iOS, or if the PC is suspended, the browser to reactivate stops receiving notifications from the server. deal with the connectionSlow event or in error, and reconnect the client but this did not work. Any suggestions?
//esta es la inicializacion de signalr
//Bus
transit = $.connection.transit;
transit.client.updateBus = updateBus;
transit.client.initBuses = initBuses;
$.connection.hub.start({ transport: ['serverSentEvents', 'foreverFrame'] }).done(function () {
transit.server.init();
});
$.connection.hub.connectionSlow(function () {
try {
$.connection.hub.stop();
}
catch (err) {
console.log(err);
}
finally {
$.connection.hub.start({ transport: ['serverSentEvents', 'foreverFrame'] }).done(function () { });
}
});
$.connection.hub.error(function (error) {
try {
console.log(error);
$.connection.hub.stop();
}
catch (err) {
console.log(err);
}
finally {
$.connection.hub.start({ transport: ['serverSentEvents', 'foreverFrame'] }).done(function () { });
}
});