-
Notifications
You must be signed in to change notification settings - Fork 496
Description
Is your feature request related to a problem? Please describe.
We are currently about to start a PoC in 2 weeks with a major retail company connecting devices to smartphones via PWA app. The customers wants to use Web Assembly. The scale of the solution is about many millions of users in the next 2 years starting Q1-2021.
Describe the solution you'd like
We would like to get support for the DeviceClient when its running in the browser using web assembly. To avoid "PlatformNotSupported" and prevent exceptions.
Describe alternatives you've considered
Alternative would be to use a custom implementation maybe without web assembly which is not what the customer prefers.
Additional context
Here is an example to what we see once we want to sent telemetry in a blazor application. An exception is thrown while setting the SslProtocol which is unsupported and in the new version of .NET flagged with an annotation. There are also analyzers available for blazor which help us to figure out what API is supported.
The .NET team has added annotation in the API to understand what is supported: https://github.com/dotnet/runtime/blob/1b18efa5b55df1cbf13838f6ba32d9d59fa147b1/src/libraries/System.Net.Http/src/System/Net/Http/HttpClientHandler.cs#L281
We are setting some settings on the HttpClientHandler when there is no handler supplied in the ctor - which is throwing the platform exceptions. Maybe we could check in the ClientFactory what platform we are running and preconfigure a proper one and skipping the specific settings like proxy etc..
Here is an example:
| httpClientHandler.SslProtocols = TlsVersions.Instance.Preferred; |
