Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Nodejs Socket.io is working on desktop safari, but not iPhone device

    • 1
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 1.47k
    Answer it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: