peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.52k stars 1.44k forks source link

iOS Safari not receiving DataConnection message #786

Open zhudanmeng opened 3 years ago

zhudanmeng commented 3 years ago

The connection is established and opened, but when one peer (chrome PC) sends a message through the DataConnection the peer on iOS Safari doesn't activate the DataConnection.on("data", ...)_ event.

The serialization is set to JSON. This works for other devices, just not Safari.

From message sender:

var msg = peer.connect(userData.id, { serialization: "json"});
msg.on('open', function() {

  console.log("opened and sent", msg)
  msg.send('LetIn');
        });

Message receiver (Safari):

    msg.on('open', function() {
            console.log("data connection opened");
            msg.on('data', function(data) {
            console.log("received data ", data)
        }
}

console.log("opened and sent", msg) was called but the console.log("received data ", data) line was never called.

Limyt commented 3 years ago

I have the same problem and cannot receive data for the first time

Limyt commented 3 years ago

I try to upgrade the system version, I can receive data