startUXCam static method

Future<void> startUXCam()

Initialize UXCam

Implementation

static Future<void> startUXCam() async {
  if (kIsWeb || !Platform.isAndroid && !Platform.isIOS) return;

  final sessions = DSRemoteConfig.I.getUXCamSessions();
  if (sessions != 0 && sessions < DSPrefs.I.getSessionId()) {
    return;
  }

  if (_uxCamInitializing) return;
  _uxCamInitializing = true;
  try {
    reportEvent('uxcam starting');
    await FlutterUxcam.optIntoSchematicRecordings(); // Confirm that you have user permission for screen recording
    final config = FlutterUxConfig(
      userAppKey: _uxCamKey,
      enableAutomaticScreenNameTagging: false,
    );
    await FlutterUxcam.startWithConfiguration(config);
    reportEvent('uxcam started');
    unawaited(FlutterUxcam.setUserIdentity(yandexId));
    _uxCamRunning = true;
  } finally {
    _uxCamInitializing = false;
  }
}