Closed chenshaxuanjing closed 1 year ago
Having the same error...
+1 same error and its a platform exception so its showing in crashlytics too. Need to remove this lines from the library
if (statusChangeResult.errorMessage != null) {
throw PlatformException(code: 'channel-error', message: statusChangeResult.errorMessage);
}
error:
my code:
` Future createSocket() async{
String token = await getAccessToken();
signalR = SignalR(
serverUrl,
"hubs/arkhub",
hubMethods: ["onOrderMatched","onOrderCancelled","onOrderCancelled"],
headers: {"Authorization":"Bearer "+token},
statusChangeCallback: _onStatusChange,
hubCallback: _onNewMessage,
);
}
Future startSocket() async{
final isConnected = await signalR.isConnected();
if (!isConnected) {
final connId = await signalR.connect();
print("Connection ID: $connId");
} else {
signalR.stop();
}
}`