Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket neither emitting nor retrieving. #145

Open
alvin-george opened this issue Oct 16, 2017 · 0 comments
Open

Socket neither emitting nor retrieving. #145

alvin-george opened this issue Oct 16, 2017 · 0 comments

Comments

@alvin-george
Copy link

alvin-george commented Oct 16, 2017

This is my configuration.

var socket = SocketIOClient(socketURL: URL(string: "http://eyalzayed.com")!,config: [.log(true), .connectParams(["civilId" : "CIV1T111"]),.reconnects(true),.reconnectAttempts(2),.reconnectWait(2000),.forcePolling(true)])

On ViewDidLoad, I am connecting it.. It works..

override func viewDidLoad() {
    super.viewDidLoad()
    self.socket.connect()
}

But On Emitting Messages:

let parameters = ["from": "CIV1T111", "to": "CIV1F111", "fromName": "Alvin","toName": "Test parent", "message": "my test message", "timeStamp": "(timeStampString)"]
self.socket.emit("new message", with: parameters)

Its not sending message on server.

The same way, the retrieving of messages also not working..

socket.on("new message") { (dataArray, socketAck) -> Void in
 print("dataArray : \(dataArray)")
}

Any solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant