Skip to content

Commit

Permalink
adjustments on OS support
Browse files Browse the repository at this point in the history
  • Loading branch information
miquelbeltran committed Oct 11, 2024
1 parent 8a0561b commit c370645
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/Raygun.Blazor/RaygunBlazorClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,23 @@ public async Task RecordExceptionAsync(Exception ex,
}

EnvironmentDetails? environment;
if (OperatingSystem.IsLinux() || OperatingSystem.IsWindows() || OperatingSystem.IsMacOS())
if (OperatingSystem.IsBrowser() || OperatingSystem.IsIOS() || OperatingSystem.IsAndroid())
{
// If running on Server or Desktop device (MAUI Hybrid), obtain environment details from the runtime
// If running on browser (e.g. WebAssembly)
// or Mobile MAUI Blazor Hybrid apps (iOS or Android),
// obtain environment details from the browser
environment = await _browserInterop.GetBrowserEnvironment();
}
else
{
// If running on Server (Linux, Windows, MacOS, etc.)
// or Desktop MAUI Hybrid apps (Windows or Mac Catalyst),
// obtain environment details from the runtime
environment = EnvironmentDetails.FromRuntime();
// Add browser details to userCustomData
// Add user browser details to userCustomData
userCustomData ??= [];
userCustomData.Add("BrowserEnvironment", await _browserInterop.GetBrowserEnvironment());
}
else
{
// If running Browser or Mobile device (MAUI Hybrid), obtain environment details from the browser
environment = await _browserInterop.GetBrowserEnvironment();
}


var request = new RaygunRequest
Expand Down

0 comments on commit c370645

Please sign in to comment.