m3_lightmeter/lib/data/analytics/api/analytics_firebase.dart
Vadim a52efcd341
ML-130 Integrate Firebase Remote Config (#132)
* implemented `RemoteConfigService`

* added alternative translations

* typo

* added `firebase_analytics`

* dim paid features list tiles

* log list tile tap instead of dialog

* implemented `RemoteConfigProvider`

* typo
2023-10-31 18:42:25 +01:00

26 lines
830 B
Dart

import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/foundation.dart';
import 'package:lightmeter/data/analytics/api/analytics_api_interface.dart';
import 'package:lightmeter/data/analytics/entity/analytics_event.dart';
class LightmeterAnalyticsFirebase implements ILightmeterAnalyticsApi {
const LightmeterAnalyticsFirebase();
@override
Future<void> logEvent({
required LightmeterAnalyticsEvent event,
Map<String, dynamic>? parameters,
}) async {
try {
await FirebaseAnalytics.instance.logEvent(
name: event.name,
parameters: parameters,
);
} on FirebaseException catch (e) {
debugPrint('Firebase Analytics Exception: $e');
} catch (e) {
debugPrint(e.toString());
}
}
}