Crash reporting for Windows apps
You need to do a minimum configuration to get started with Apptics crashes. Before you begin, make sure that your app is already registered and configured in Zoho Apptics.
- If not, then create a project and add your app in Apptics and download the config.plist file for your app.
- Crashes are automatically tracked in Apptics using the (init) method when you do the initialization for Analytics by subscribing to the UnhandledException.
- If App.Unhandled_Exception event is subscribed , please note that Apptics library wouldn't be able to track crash automatically.
Customized crash handling:
- You can handle the crash (unhandled exception) using the event Instance_UnhandledException which provides the exception which caused the crash.
- Subscribe to the event Initializer.Instance.UnhandledException.
For UWP apps
Copied
For WinUI apps
Copied
- Implement the event in your code as given below:
For UWP apps
Copied
For WinUI apps
Copied
Note:
- Make sure that you call this.Exit() in the Instance_UnhandledException event handler, else the app stays alive and the crashes are not reported.
- Crash reports will be collected by default, irrespective of user consent. Based on the consent provided we will sync the data.
- We will send it to the server if the user opted in, or else the developer will have to call the "SendCrashIfAny" function.
- On-call of that function, we will show a crash consent popup, if the user opted out to send a crash.
- If you have registered an UnhandledException event in your App.xaml.cs, you need to call the below function to add crash.
For UWP apps
Copied
For WinUI apps
Copied
NOTE:
- Crash reports are collected by default irrespective of user consent.
- We will send the crash reports to the server only if the user has opted in, or else the developer will have to call the "SendCrashIfAny" function.
- On-call of that function we will show a crash consent popup if the user opted out to send a crash.
- The data is synced based on the consent provided.
You can also add your crash as string params like below function.
Copied