Skip to main content

Crash callback handling (GUACrashObserver)

Set additional crash log data reporting

[MSDK & Player Network SDK] When the application crashes, you may need to report additional custom data together with the crash log to the CrashSight platform.This allows users to better identify the cause of the crash.Reported data can be found in the CrashSight platform under Trace Log > Attachment Information.For more information, see MSDK documentation.

The naming conventions for these files differ between Android and iOS.

note

It is strongly recommended that games register in the application startup function.

Function Definition

event OnStringRetEventHandler<GUABaseResult> CrashBaseRetEvents;

Code Example

// Initialization
UnionAdapterAPI.GetCrashService().SetCrashCallback();
// Add callback
UnionAdapterAPI.GetCrashService().CrashBaseRetEvents += OnCrashBaseResult;

// Remove callback
UnionAdapterAPI.GetCrashService().CrashBaseRetEvents -= OnCrashBaseResult;

// CrashBaseRetEvents callback handling
private string OnCrashBaseResult(GUABaseResult baseRet)
{
// this is not unity ui process, don't do anything about unity
return "this is Unity extra data when crash happened.";
}