File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ fun connectToChatRoom() {
1515
1616 // Create the Socket
1717 val params = hashMapOf(" token" to " abc123" )
18- val socket = PhxSocket (" http://localhost:4000/socket/websocket" , multipleParams )
18+ val socket = Socket (" http://localhost:4000/socket/websocket" , params )
1919
2020 // Listen to events on the Socket
2121 socket.logger = { Log .d(" TAG" , it) }
@@ -27,9 +27,9 @@ fun connectToChatRoom() {
2727
2828 // Join channels and listen to events
2929 val chatroom = socket.channel(" chatroom:general" )
30- chatroom.on(" new_message" ) {
31- // `it` is a PhxMessage object
32- val payload = it.payload
30+ chatroom.on(" new_message" ) { message ->
31+ val payload = message.payload
32+ .. .
3333 }
3434
3535 chatroom.join()
@@ -46,9 +46,9 @@ val client = OkHttpClient.Builder()
4646 .build()
4747
4848val params = hashMapOf(" token" to " abc123" )
49- val socket = PhxSocket (" http://localhost:4000/socket/websocket" ,
50- multipleParams ,
51- client)
49+ val socket = Socket (" http://localhost:4000/socket/websocket" ,
50+ params ,
51+ client)
5252```
5353
5454
You can’t perform that action at this time.
0 commit comments