lepicekmichal / SignalRKore

A Kotlin multiplatform coroutine-based SignalR client.
Apache License 2.0
22 stars 3 forks source link

Any plans for REST Transport Fallback? #9

Open sebanitu opened 2 weeks ago

sebanitu commented 2 weeks ago

Hi there!

I am really interested in using your library in our under development multi platform app. However, the resulting app also contains an iOS AppClip target which can't use a socket connection as per Apple's design. Is there a chance that we might see support for transport fallback to HTTP REST anytime soon?

Warm regards, Sebastian

lepicekmichal commented 1 week ago

Hi, sorry for the late reply. I am not too familiar with iOS so please bear with me.

As per quick search, wouldn't this library work as long as you turn off the websocket transport? There is still long polling transport and in the future (when ktor 3 is out) server sent events will also be supported.

So if you can easily try, it should just be:

HubConnectionBuilder
    .create(url) {
        transportEnum = TransportEnum.LongPolling
    }
sebanitu commented 1 week ago

Thanks for the information! I'll definitely give it a try. On a different note, how much effort do you think it would take to bring this to JS? I'm considering exploring it when I have some free time and was curious if you had any insights on the level of effort involved.

lepicekmichal commented 1 week ago

I honestly have no idea. I think not much effort should be needed. But then again, it is totally different architecture, so there might be some big bump on the road I'm not seeing.