Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to receive message in SignalR iOS background?

Tags:

ios

swift

signalr

I have implement the SignalR in iOS app it receive the events in Foreground but app enters into background the receive events not working..

How can I receive signalR message in App Background

like image 289
Rajesh Avatar asked Oct 31 '25 02:10

Rajesh


1 Answers

SignalR in a mobile app will only work when your app is in foreground.

Once the app is moved to background, SignalR connections are closed, and therefore your user can't receive any messages.

A way to go around this would be to use Push Notifications, so that as soon as your user get's disconnected from your SignalR endpoint, you can send him notifications to let him know that new messages arrives for him.

Don't forget to save messages that a given user didn't receive, as SignalR only buffers messages for temporary disconnects.

like image 133
Benjamin Soulier Avatar answered Nov 01 '25 22:11

Benjamin Soulier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!