|
|
|
|
@ -41,8 +41,6 @@ class SignalRHelper {
|
|
|
|
|
url,
|
|
|
|
|
HttpConnectionOptions(
|
|
|
|
|
client: IOClient(HttpClient()..badCertificateCallback = (x, y, z) => true),
|
|
|
|
|
|
|
|
|
|
//TODO: IT MUST BE WEB SOCKETS
|
|
|
|
|
transport: HttpTransportType.webSockets,
|
|
|
|
|
logging: (level, message) => log(message),
|
|
|
|
|
))
|
|
|
|
|
@ -57,7 +55,11 @@ class SignalRHelper {
|
|
|
|
|
|
|
|
|
|
connection!.on('addChatMessage', (message) => onUpdateAvailable(message));
|
|
|
|
|
|
|
|
|
|
await connection!.start();
|
|
|
|
|
try {
|
|
|
|
|
await connection!.start();
|
|
|
|
|
} catch (e) {
|
|
|
|
|
logger.i("Exception while connecting: ${e.toString()}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void sendMessage(List<dynamic> args) async {
|
|
|
|
|
@ -78,7 +80,6 @@ class SignalRHelper {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// startConnection(BuildContext context) async {
|
|
|
|
|
// if (connection!.state == HubConnectionState.connected || connection!.state == HubConnectionState.connecting) {
|
|
|
|
|
// connection!.off('addChatMessage');
|
|
|
|
|
|