Open yahyaizala opened 1 year ago
yes same for me, nothing works.
Absolutely same. Neither emit
, emitWithAck
or send
don't work. While messages from the server still can be received
Same problem here. Emit is not working
Add, {'transports': ['websocket']}
IO.Socket socket = IO.io('http://localhost:3000', <String, dynamic>{
'transports': ['websocket'],
});
For more info https://github.com/rikulo/socket.io-client-dart/issues/134#issuecomment-749295262
Hi there, I faced an issue. I can connect socket.io server and server can send me events too. Bu in iOS and android application I can not send any message to server via emit and send functions.
import 'dart:async'; import 'dart:convert'; import 'dart:io';
import 'package:flutter/material.dart'; import 'package:meetmed/Screen/MainView.dart';
import 'package:socket_io_client/socket_io_client.dart' as IO;
void main() { IO.Socket client; client = IO.io( Platform.isAndroid ? "http://10.0.2.2:8080" : "http://localhost:8080", IO.OptionBuilder() .setTransports(["websocket"]) .enableAutoConnect() .build());
client.onConnect((_) { print("connection worked on ${client.id} socket id"); client.emit("onAuth", {"data": "test data"});
});
client.on("message", (data) { print("message received ${data}"); }); client.on("me_connected", (data) { print("me connected worked ${data}"); client.emit("onAuth", {"data": "send yoy"}); }); client.on("onAuth", (data) { print("on auth message $data"); }); client.onError((data) { print("Error occured $data"); });
runApp(const MainView()); }
Os : macOS Air M1 chip socket.io version 4.6.0 (js server)
socket.client version 2.0.1 (flutter package)