I have a simple application written in react native that uses a nodejs server connection with socket.io. My problem is that when the phone screen is locked the socket disconnects from the server. I need the always connected connection.
//server
const app = express();
const server = require('http').Server(app);
const io = require('socket.io')(server,{
pingInterval: 20000,
pingTimeout: 10000,
});
//client mobile
const io = socket("http://192.168.0.20:3003");