reportFirstEvent static method

  1. @Deprecated('Use event sending with type [EventSendingType.oncePerApplifetime] in the [DSMetrica.reportEvent] method')
void reportFirstEvent(
  1. String eventName, {
  2. Map<String, Object>? attributes,
  3. int stackSkip = 1,
})

Send only one event per app lifetime

Implementation

@Deprecated('Use event sending with type [EventSendingType.oncePerApplifetime] in the [DSMetrica.reportEvent] method')
static void reportFirstEvent(String eventName, {Map<String, Object>? attributes, int stackSkip = 1}) {
  final firstEvent = DSPrefs.I.internal.getString(_firstEventParam);
  if (firstEvent != null) return;
  DSPrefs.I.internal.setString(_firstEventParam, eventName);
  reportEventWithMap(
    '$eventName (first event)',
    attributes,
    stackSkip: stackSkip + 1,
    eventSendingType: EventSendingType.oncePerAppLifetime,
  );
}