Application Insights in Shared Uno Project? #8604
Replies: 4 comments 7 replies
-
AppCenter should be working for Xamarin heads properly. Wasm is not supported, as there's no available support for it from Microsoft. You could try opening an issue on their repository: https://github.com/Microsoft/appcenter. For app insights, you can find an example here in Nuget Package Explorer. |
Beta Was this translation helpful? Give feedback.
-
I thought about using AppCenter SDK for UWP and Mobile, and for other platforms including WASM using ApplicationInsights. |
Beta Was this translation helpful? Give feedback.
-
For anyone who is interested in getting Application Insights working in WASM. I've managed to get it working. Sure its probably not the best, but it works really well. var appInsights;
define([`https://js.monitor.azure.com/scripts/b/ai.2.min.js`], m => {
try {
var snippet = {
config: {
instrumentationKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
};
var init = new m.ApplicationInsights(snippet);;
appInsights = init.loadAppInsights();
console.log("Insights loaded.");
}
catch (error) {
console.log("Loading failed: " + error);
}
});
function CallPageLoad() {
console.log("Insights intialized.");
try {
appInsights.trackEvent({ name: 'WASM Home Page Loaded.' });
appInsights.trackPageView({ name: "WASM Home Page" });
console.log("WASM Insights called.");
}
catch (err) {
console.log(err);
}
} Then from code behind in UNO: #if __WASM__
WebAssemblyRuntime.InvokeJS("CallPageLoad();");
#endif |
Beta Was this translation helpful? Give feedback.
-
Is this still the way to use Application Insights in Uno? Or is there an alternative for app insights? |
Beta Was this translation helpful? Give feedback.
-
Has anyone used Application Insights in an Uno Project? I am trying to use the Logging and Telemetry in a cross-platform way. Here is what I have tried:
Using App Center Analytics and Crashes for IOS, ANDROID and UWP, then having App Center automatically export it to Application Insights. That works fine.
The problem I am having is trying to get Application Insights working on the WASM project.
The WASM project just stops on the following code is run:
Any ideas I could try?
Beta Was this translation helpful? Give feedback.
All reactions