You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**\*Blazor WebAssembly**: Requires `IJSRuntime` parameter in constructor. The SDK automatically uses browser-native implementations via JavaScript interop for both WebSocket and HTTP Stream transports.
54
+
**\*Blazor WebAssembly**: Requires `builder.Services.AddCentrifugeClient()`in `Program.cs`. The SDK automatically uses browser-native implementations via JavaScript interop for both WebSocket and HTTP Stream transports.
58
55
59
56
**Unity WebGL**: Requires a third-party WebSocket plugin. HTTP Stream is not supported in WebGL.
// Client will try WebSocket first, then fall back to HTTP Stream if needed
267
261
client.Connect();
268
262
```
269
263
264
+
**Note**: In Blazor WebAssembly, ensure you've called `builder.Services.AddCentrifugeClient()` first (see Blazor Support section). The SDK will automatically use browser-native transports.
265
+
270
266
### Advanced Configuration
271
267
272
268
```csharp
@@ -279,7 +275,7 @@ var options = new CentrifugeClientOptions
// DisposeAsync waits for disconnect to complete before releasing resources
593
-
awaitClient.DisposeAsync();
572
+
if (_client!=null)
573
+
{
574
+
await_client.DisposeAsync();
575
+
}
594
576
}
595
577
}
596
578
```
597
579
598
-
**Important**: The JavaScript interop file is automatically included as a static asset. If you encounter module loading issues, ensure your `index.html` has the standard Blazor script tag:
580
+
**How it works:**
581
+
582
+
- The SDK automatically uses browser-native transports when `AddCentrifugeClient()` is called
583
+
- WebSocket uses browser's native WebSocket via JS interop
584
+
- HTTP Stream uses browser's Fetch API with ReadableStream
585
+
- No need to pass `IJSRuntime` to constructors - it's configured globally
586
+
587
+
**Important**: The JavaScript interop modules are automatically included as static assets. Ensure your `index.html` has the standard Blazor script tag:
0 commit comments