logShare method

Future<void> logShare({
  1. required String contentType,
  2. required String itemId,
  3. required String method,
  4. Map<String, Object?>? parameters,
})

Logs the standard share event.

Apps with social features can log the Share event to identify the most viral content.

See: https://firebase.google.com/docs/reference/android/com/google/firebase/analytics/FirebaseAnalytics.Event.html#SHARE

Implementation

Future<void> logShare({
  required String contentType,
  required String itemId,
  required String method,
  Map<String, Object?>? parameters,
}) {
  _assertParameterTypesAreCorrect(parameters);

  return _delegate.logEvent(
    name: 'share',
    parameters: filterOutNulls(<String, Object?>{
      _CONTENT_TYPE: contentType,
      _ITEM_ID: itemId,
      _METHOD: method,
      if (parameters != null) ...parameters,
    }),
  );
}