question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to send SignalR message to specific user by UserId

See original GitHub issue

i have learnd alot using this … and i started using aspnetboilerplate in my work (universty system) i should say thank u for this great job

i am trying to send signalr message using userid

i can send using this and it work fine :

await Clients.All.SendAsync("getMessage", "test message text"); but nothing received when i try this … my code :

public async Task SendMessage(string message){ var r = _onlineClientManager.GetAllByUserId(new UserIdentifier(null, 10002)); var rr = r.Select(x => x.ConnectionId).ToList(); await Clients.Clients(rr).SendAsync("getMessage", "test message text");}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
abuslahcommented, Jun 16, 2018

Finaly ! I did it by using

await Clients.User("1").SendAsync("getMessage", new ChatMessage("test message", AbpSession.UserId));

and i can send it to list of users Clients.Users( List<string> userIds)

I don’t need connectionsIds list for the users who I will send the message for sorry about my English $:

0reactions
ismcagdascommented, Dec 29, 2022

So, why do you ask it here ? You can create an issue on https://github.com/abpframework/abp

Read more comments on GitHub >

github_iconTop Results From Across the Web

SignalR - Sending a message to a specific user using ...
In the latest version of Asp.Net SignalR, was added a new way of sending a message to a specific user, using the interface...
Read more >
Send message to specific user in SignalR
Today post I will write small demo to demonstrate how to send message to specific user using their connection id in SignalR.
Read more >
How to send notification to specific user's using custom ...
What you need to do when you create the JWT is to add a claim for ClaimTypes.NameIdentifier with the value of the UserId....
Read more >
Mapping SignalR Users to Connections
Single -user groups ... You can create a group for each user, and then send a message to that group when you want...
Read more >
C# – How to Send Message To specific User with signalR
You can send broadcast message to all Users without connection id. You just need to assign a Unique ID to Every user and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found