nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

How to add array in connectparams using swift.... #88

Open nirma358 opened 8 years ago

nirma358 commented 8 years ago

let params:Dictionary = ["authtoken":auth!,"namespace":"vinay@123.com","owner_id":ownerId,"status":"online","addas":["1","2"]]

    socket = SocketIOClient(socketURL: "192.168.1.80:3310",options:[.ConnectParams(params),.Log(true),.ForceWebsockets(true)])
    socket.connect();

I am using above code ......app is crashing...when connecting.. if i remove addas parameter = ["1","2"].....it runs fine.....i guess its not encoding array in Dictionary

nirma358 commented 8 years ago

let params:Dictionary = ["authtoken":auth!,"namespace":"vinay@123.com","owner_id":ownerId,"status":"online","addas":["1","2"]]

        socket = SocketIOClient(socketURL: "192.168.1.80:3310",options:[.ConnectParams(params),.Log(true),.ForceWebsockets(true)])
        socket.connect();

I am using above code ......app is crashing...when connecting.. if i remove addas parameter = ["1","2"].....it runs fine.....i guess its not encoding array in Dictionary

nuclearace commented 8 years ago

What's it crashing with?

nirma358 commented 8 years ago

in file SocketEngine.swift :-
for webSocket:- ws = WebSocket(url: NSURL(string: wsUrl)!)
for http:- let reqPolling = NSMutableURLRequest(URL: NSURL(string: urlPolling + "&b64=1")!)

NSUrl returning nil in both cases

nuclearace commented 8 years ago

Does this work in the JS client?