Flutter SDK - start 方法
此方法用于启动跟踪器。启动跟踪器后,会话录制即开始。
Future<void> OpenReplay.instance.start({
required String projectKey,
OROptions options = OROptions.defaults,
String? serverUrl,
})
projectKey: String:可在 OpenReplay 仪表盘的 ‘Preferences > Projects’ 下找到。options: OROptions:跟踪器捕获哪些内容,见下文。serverUrl: String?:自托管部署的数据上报(ingest)端点。使用 OpenReplay Cloud 时请省略。
初始化选项
Section titled 初始化选项可用选项:
crashes: bool捕获 Dart 错误。analytics: bool捕获触摸、滑动、屏幕和输入。performances: bool捕获 CPU、内存、电池和温度状态。logs: bool捕获debugPrint输出。screen: bool启用帧捕获。screenshotBatchSize: ScreenshotBatchSize每次上传的帧数——low(10)、normal(20)、high(30)。默认值:normal。targetLongEdge: int捕获帧的最长边,单位为像素。默认值:720。dedupeFrames: bool跳过与上一帧完全相同的帧。maskPlatformViews: bool用占位符覆盖 WebView、地图和相机预览。wifiOnly: bool预留选项;尚未生效。debugLogs: bool/debugImages: boolSDK 自身的调试输出。默认值:false。
默认值:除 debugLogs 和 debugImages 外,所有布尔选项均为 true。有关每个选项的完整说明,请参阅初始化。
帧率和图像质量来自你的项目设置,而不是这些选项。
若要在不创建会话的情况下录制到滚动缓冲区中——以便稍后的触发可以发送之前几秒的内容——请使用 coldStart() 启动,并通过 triggerRecording() 将其升级为正式录制:
await OpenReplay.instance.coldStart(projectKey: 'YOUR_PROJECT_KEY');
// later, when something worth recording happens
await OpenReplay.instance.triggerRecording(condition: 'checkout_error');
Flutter SDK 尚不支持服务端条件评估;请在你自己的代码中调用 triggerRecording()。