Table of Contents

How to record and forward AR session dump files

AR session dump files are the core basis for the EasyAR team to troubleshoot and track issues.

Before you begin

What is an AR session dump file

중요

AR session dump files are the most important basis for analyzing and resolving Mega positioning and tracking issues on WeChat Mini Programs.

AR session dump files record the critical spatiotemporal context during Mega positioning requests in mini programs.

How to record and forward

Control the recording process by calling the session.dumpSession(signal: boolean) interface:

  • Pass true: Start recording.
  • Pass false: Stop recording and return the generated temporary file path (tempFilePath).

It is generally recommended to bind the recording logic to a UI button. Use the wx.showToast() method to notify when recording starts, and use the wx.shareFileMessage() method to forward the recorded file via WeChat chat when recording ends.

/**
 * Handle session recording logic
 * @param signal true to start recording, false to stop recording and forward
 */
dumpSession(signal: boolean): void {
  // Call interface to get path
  const recordPath = session.dumpSession(signal);
  // When signal is true, the interface returns an empty string, indicating recording is in progress
  if (recordPath.length == 0) {
      wx.showToast({
          title: 'Start recording data',
          icon: 'success',
          duration: 2000
      });
      return;
  }
  // When signal is false, process the returned file path
  wx.shareFileMessage({
      filePath: recordPath,
      success() {
          wx.showToast({
              title: 'Recording and forwarding successful',
              icon: 'success',
              duration: 2000
          });
      },
      fail() {
          wx.showToast({
              title: 'Recording and forwarding failed',
              icon: 'error',
              duration: 2000
          });
      }
  })
}

This example demonstrates how to use the session.dumpSession() method in the xr-frame component to record and forward AR session dump files, along with corresponding Toast notifications.


참고

Due to mini program local storage limitations (typically 200MB), it is recommended not to record for too long in a single session, and the maximum recording duration should not exceed 10 minutes.