pkyeck / socket.IO-objc

socket.io v0.7.2 — 0.9.x for iOS and OS X
MIT License
1.97k stars 439 forks source link

Update SocketIO.m #208

Open jnoring opened 10 years ago

jnoring commented 10 years ago

sendEvent assumes the incoming data isn't an NSArray already; this causes it to double-wrap NSArray objects (so instead of [data], you end up with [[data]]. Check if the incoming objet is of type NSArray, and if so pass it along verbatim.

jnoring commented 10 years ago

It's possible I'm not understanding how this code works, but I have some server communication using socket-io that expects the args argument to be something like "[NSDictionary, NSString]" (which is likely bogus, but nonetheless, what I have to work with). If there's another way to do this, I'm all ears.

aldevet commented 9 years ago

I was having issues with multiple parameters like:

socket.on('publish', function (options, sdp, callback) {

Because of the double-wrap all data will go to first parameter. This pull request solves it, hope it merges!