Here is the code implemented for socket connection but it did not working. I want to create chat messaging app in react native with realtime updates which uses backend of our web side server. I am trying to connect my app to socket io but its not working.
I have used socket.IO-client
for react native:
import SocketIOClient from 'socket.IO-client'
export default Class Socket extends Component{
constructor(){
super();
var Live_URL = "https://xxx.xxxxxxx.xxx/"
this.socket = SocketIOClient(Live_URL);
}
componentDidMount(){
this.socket.connect();
this.socket.on("connect", () => {
console.log('connection.')
});
}
}
Please, any solution?