socket.io-client-swift icon indicating copy to clipboard operation
socket.io-client-swift copied to clipboard

How to convert SocketAnyEvent to json?

Open HugoHeneault opened this issue 4 years ago • 0 comments

Hi there,

I'm quite new to Swift, so forgive me if there is a simple solution. I'm building a cordova plugin and would like to relay the socket.onAny() events to the JS app.

I thought I could simply relay the event as JSON, but I can't find a way to encode the SocketAnyEvent because it has an [Any] property which can't be simply json-encoded... Each SocketAnyEvent has a different items structure, I'm struggling (can't use Swift's Codable)

Has anyone of you already done that? Thanks alot for your help.

HugoHeneault avatar Aug 30 '21 08:08 HugoHeneault