I have as issue in which socket.io is not starting on any iPhone device. I have searched for it and went through some solutions but nothing worked. Here are some issue links:
https://github.com/Automattic/socket.io/issues/976
http://www.codedisqus.com/7yzSqUgqge/socketio-working-on-desktop-safari-chrome-but-not-mobile.html
Here is the code
io.sockets.on('connection', function(socket) {
process.emit('client-connection', socket.id);
socket.on('authenticate', function(message) {
console.log('Authenticating client with key "' + message.authToken + '"');
authenticateClient(socket, message);
});
socket.on('message', function(message) {
if (io.sockets.sockets[socket.id] && message.hasOwnProperty('type')) {
if (message.hasOwnProperty('channel')) {
if (settings.clientsCanWriteToChannels || ChannelIsClientWritable(message.channel)) {
process.emit('client-message', socket.id, message);
}
}
return;
}
});
socket.on('disconnect', function () {
console.log("in disconnect");
process.emit('client-disconnect', socket.id);
cleanupSocket(socket);
});
})
This script executes well for browser but it does not work for iPhone device.
Please let me know if you need any other detail.?
Thanks in advance.
1 Answer(s)