AS-Devs / signalr_flutter

A flutter plugin for .net SignalR client.
https://pub.dev/packages/signalr_flutter
MIT License
19 stars 27 forks source link

Get Connection Id #36

Closed majidfathi69 closed 1 year ago

majidfathi69 commented 3 years ago

I wrote this code and now I need to find out how to get the connection id from mySignalR object.

mySignalR = SignalR('URL', "Hub",
        hubMethods: ["GetSellsInit", "GetSells"],
        statusChangeCallback: _onStatusChange,
        queryString: "logintoken=xyz",
        hubCallback: _onNewMessage)

some example in javascript:

var connection = $.hubConnection("URL");
var hub = connection.createHubProxy("Hub");
connection.id
AyonAB commented 1 year ago

After the successful signalr connection, you can get the connection id with mySignalR.connectionId. Try out the pre release package if you are having any trouble. I will soon push a stable update.