How to use SignalR on Flutter?
Asked Answered
D

2

14

I am trying to communicate with an Asp.Net core 2.1 application that uses SignalR to establish its chat communications, but I can't figure out what's the best way to accomplish that using flutter.

I've searched for some library to do that, but the one that I found was not compatible with Flutter, just with Dart web as it uses the original SignalR.js to wrap the methods.

How to accomplish that task?

Doctor answered 22/6, 2018 at 3:31 Comment(2)
I'm not sure about Flutter, specifically, but you should keep in mind that SignalR is just a library for working with web sockets. It comes with both server-side and client-side components/libraries, but that doesn't mean you have to use them in tandem. In other words, you can set up all your SignalR hubs server-side, and theoretically, any library that supports working with web sockets that's compatible with Flutter should be able to utilize those.Slippery
Hi @ChrisPratt, I`ve seen that but the thing is that you need to know the messages and hub characteristics used by signalr to interact using websockets, as its has a lote of things happening instead of only the websocket part, it has negotiation, authorization and et all.Doctor
B
22

I just created a Flutter client for SignalR (ASP.NET Core). You can find it at Pub

Barclay answered 18/10, 2018 at 7:38 Comment(6)
wow, there is even such a package?! There is just about everything for flutter:)Inodorous
It made me upset because it doesn't support .Net Framework SignalR.Jeremiah
Is there any way to connect to ".Net Framework SignalR". Badly need this oneNotary
@SohailAhmad have you find any way to connect with SignalR?Bruiser
@JuthiSarkerAka Yes I have created a proxy layer of Interactive_Webview plugin, connecting socket there, capturing its traffic and playing with that. it is bit tricky but pretty awesome, working smoothly with me.Notary
It's not a null safety package.Silkweed
H
6

If flutter plugins are not available for Signalr, you can always use native libraries available for signalr and use flutter's platform channels to use those native features in your flutter code.

Here are some helpful resource that might help

How to use signalr in Android?

https://github.com/Gurgen/SignalR-.net-core-android-client

Flutter platform channels

Highoctane answered 22/6, 2018 at 9:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.