Skip to main content

GUACrashObserver

Set additional log data reporting for crashes

[MSDK & Player Network SDK] When the program crashes, additional custom data may need to be reported to the CrashSight platform along with the crash log. This will allow users to better locate the cause of the crash. The reported data can be found in the CrashSight platform under Trace Log > Attachment Information. For more information, see MSDK document.

For these two files, Android and iOS use different naming conventions.

note

It is strongly recommended to perform registration in the startup function of the game application.

Function Definition

event OnStringRetEventHandler<GUABaseResult> CrashBaseRetEvents;

Code Sample

// Initialize
UnionAdapterAPI.GetCrashService().SetCrashCallback();
// Add callbacks
UnionAdapterAPI.GetCrashService().CrashBaseRetEvents += OnCrashBaseResult;

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

// CrashBaseRetEvents callback
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.";
}