How to emit RTCIceCandidate data in socket.io library in swift

22 Views Asked by At

I have tried to emit my code using socket.io library but i got error mentioned below. reason: 'Invalid type in JSON write (RTCIceCandidate)' Here is my code.

var dict = [String:Any]()
dict["type"] = "canidate"
dict["label"] = candidate.sdpMLineIndex
dict["id"] = candidate.sdpMid
dict["canidate"] = candidate
print("============== printing ============")
print(dict)
socket.emit("candidate",  self.viewerId, dict)

I want emit data to the server. Basically i want to send RTCIceCandidate data to the server.

0

There are 0 best solutions below