3

I am running a backend with .net signalR library in order to chat a chap app with realtime features, everything is working properly when it comes to the backend itself and the web frontend but I need to connect a react native mobile app to signalR as well and that's where I'm stuck.

I have gone through the microsoft docs and didn't find any clear information if there's a specific way to connect to signalR from a mobile app.

I have used both @microsoft/signalr and @aspnet/signalr libraries in order to try to connect from my mobile app but neither worked! All I get is an error: Error: Failed to start the connection: TypeError: Network request failed

Apparently this error is related to the backend service not allowing the incoming connection request from my mobile app.

Has anyone ever have the same situation or the need to connect a mobile react native app to signalR and faced the same issue?

ps: at first I thought it might be something related to the cors policy in my backend service, but even if I set the cors policy to allow any origin the issue still persists.

Marlon Englemam
  • 351
  • 5
  • 11

0 Answers0