Hi, @oguzhanagir
To provide context, we are implementing SignalR communication within our "Device Management Module" to facilitate real-time communication with our "Flutter App"." The app, installed on "Windows" or "Android" devices, is intended to communicate with our backend system on various events such as "Device Activation," "Online," "Offline," "Restart," etc.
The primary role of the SignalR hub is to receive events from the web, specifying both the tenant ID and device ID. Upon detecting any event from the web HUB, the SignalR hub efficiently relays the event to the corresponding Flutter App device.
I've attached a video recorded by my team that illustrates the problem we're encountering. I believe it's a minor issue that requires your guidance for resolution.
Thank you WPTL Team
Hi we tried that as well , There is no issue of HUB, Connection is getting established , But we are not able to exchange events. We also tried simple code as well `
using Microsoft.AspNetCore.SignalR;
public class CommonHub : Hub { public async Task SendEventFromClient(string eventName, string tenantId, string deviceId) { // Process the event on the server -- put this in log with time Console.WriteLine($"Event received from client: {eventName}, TenantId: {tenantId}, DeviceId: {deviceId}");
// Respond back to the client -- put this in log with time
await Clients.Caller.SendAsync("ReceiveResponse", $"Server received {eventName} for TenantId: {tenantId}, DeviceId: {deviceId}");
//send event to flutter
await _hubContext.Clients.All.SendAsync("SendEventFromClient", "ENABLE", "tenant123", "device456");
}
// Example: Send an event from the client to the server with tenantId and deviceId sendEventToServer("ENABLE", "tenant123", "device456");
`
Hi,
Certainly, we have implemented the same and also included it in the startup.cs file.
Thank you. Ajay