Last post Apr 26, 2019 01:29 PM by deepalgorithm
Apr 15, 2019 02:21 PM|Alter|LINK
How can I send notification from user A to user B if I don't know client B connectionId ? For Example i have a chat page between two users, first A-user send message to B, but user-B not located in chat-page. Of cause except A and B -users I have a lot of and
I dont need to user-X or Y or X ect catched notivication from user-A to user-B.
Apr 16, 2019 09:45 AM|Brando ZWZ|LINK
As far as I know, we couldn't send the notification through the Signalr if he doesn't have a connectionId.
Push ,notification to achieve this requirement.
The Push API gives web applications the ability to receive messages pushed to them from a server, whether or not the web app is in the foreground, or even currently loaded, on a user agent. This lets developers deliver
asynchronous notifications and updates to users that opt in, resulting in better engagement with timely new content.
More details, you could refer to below article:
Apr 16, 2019 04:07 PM|Alter|LINK
So, I need connectionId to send any notification to user via signalR or use `Push Api`? `But Push Api` do not supported in IE, Safari, iOS Safari and Opera mini. Maybe exist some other way? For example when user-A open a web site -> signalR write his own
`connectionId` to DB and other users can easy send him some notification because his `connectionId` already exist in BD. I think when user disconnected itself, old connectionId-entry in DB cleared.
Apr 17, 2019 12:24 PM|deepalgorithm|LINK
Yes you need a connection id. You should read about SignalR connection lifetime events.
Apr 23, 2019 03:18 PM|Alter|LINK
ok, got it. I have a new idea, but I need one more advice. Can I via SignalR Hub-A call Hub-B method ? Because I can't connect to 2 or more hubs at one time, but different hubs contain different logic. I think, it will be not correct merge all logic to one
Apr 26, 2019 01:29 PM|deepalgorithm|LINK
You want to use Groups for this.
See section "Groups in SignalR"