logUnlockAchievement method

Future<void> logUnlockAchievement({
  1. required String id,
  2. Map<String, Object?>? parameters,
})

Logs the standard unlock_achievement event with a given achievement id.

Log this event when the user has unlocked an achievement in your game. Since achievements generally represent the breadth of a gaming experience, this event can help you understand how many users are experiencing all that your game has to offer.

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

Implementation

Future<void> logUnlockAchievement({
  required String id,
  Map<String, Object?>? parameters,
}) {
  _assertParameterTypesAreCorrect(parameters);

  return _delegate.logEvent(
    name: 'unlock_achievement',
    parameters: filterOutNulls(<String, Object?>{
      _ACHIEVEMENT_ID: id,
      if (parameters != null) ...parameters,
    }),
  );
}