A flutter plugin for SignalR client for Android, iOS, macOS and Web

Getting Started

Note: This library is NOT compatible with ASP.NET Core SignalR

Add dependency

  signalr_socket: ^1.0.8 #latest version

Initialize SignalR Socket & connect to server.

SignalrSocket signalrSocket = SignalrSocket(
  url: '',
  hubName: 'hubName',
  eventName: 'eventName',
  queryString: {'key': 'value'},
  updateConnectionStatus: (status) {
    debugPrint("signalr socket update connection status ${}");
  newMessage: (message) {
    debugPrint("signalr socket new message $message");


Android Setup

  • Add proguard rules for release mode in android
  • Create a new file in your android project: android/app/
  • Add the following lines to the

-keep class com.github.signalr4j.client.hubs.HubResult { *; }
-keep class com.github.signalr4j.client.hubs.HubInvocation { *; }
-keep class com.github.signalr4j.client.hubs.HubProxy$* { *; }
-keep class com.github.signalr4j.client.hubs.HubConnection {*;}

If you want a HTTP url, then you need to add the following lines to the manifest of your android project.


Web Setup

    <!--other lines-->

    <script defer type="application/javascript" src="signalR_js/jquery.min.js"></script>
    <script defer type="application/javascript" src="signalR_js/signalr.js"></script>
  • And add the following line in body

    <!--other lines-->

    <script defer type="application/javascript" src="signalR_js/socketConnection.js"></script>


View Github