Reputation: 13
I am using SockIO for my Flutter project.
In production environment, the above error occurred.
Flutter version: 3.22.3
Socket_io_client version: socket_io_client: ^3.0.2
void initialize() {
socket = IO.io(
SocketEndPoint.SOCKET_URL,
IO.OptionBuilder().enableAutoConnect().build(),
);
socket.io.options?['extraHeaders'] = {'authorization': 'Bearer ${sl.get<SharedPreferenceHelper>().getJwtToken}'};
if (socket.disconnected) {
socket
..disconnect()
..connect();
socket.onConnect(
(_) {
_joinRoomConversation();
},
);
} }
Upvotes: 0
Views: 20