Replies: 3 comments 2 replies
-
Thanks for the question. We haven't done IOT Hub integrations in the Uno team, but given the specific error that you're getting, it's likely that the package that you're using may need an update specifically for wasm. Could you share the full stack trace of the exception? |
Beta Was this translation helpful? Give feedback.
-
The trace is:
I think it's a CORS issue, but I do not know if one can enable CORS on the IOT hub. I'm hoping someone might have solved it by now. Thanks for the help. Much appreciated. |
Beta Was this translation helpful? Give feedback.
-
You are correct, its in the library. I've downloaded the source and traced into it. The problem lies with: The Uno implementation for HttpClient (the WASM version) does not allow the additional parameters in the constructor. By replacing (2) below with (1) below, I got it to create a Thereafter, I think I finally ran into a CORS problem (getting an exception "Failed to fetch"), but for that I need to resolve with the Azure people. Back to HttpClient... Wouldn't say its a bug, but more a shortcoming. Do you think the devs can update the wasm's HttpClient to either:
The problem is that, without these changes, I cannot use the library Nuget as is. I need to add the complete library project to my solution and that makes it real messy. What do you suggest? Thanks for the help |
Beta Was this translation helpful? Give feedback.
-
Anyone had any success sending messages to Azure IOT Hub from a WASM application?
My code works fine for the other platforms, but when running under WASM, it throws the
System.PlatformNotSupportedException: Operation is not supported on this platform.
exception when doing aMicrosoft.Azure.Devices
send.I could not find any guidance searching through Uno Issues/Discussions.
Checking Github it acknowledges the complexities, but before going down that rabbit hole with possible AI hallucinations...
Can someone please help in case there's a working solution?
Help shall be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions