chore(observability): non-fatal crash reports + FCM nav breadcrumb
This commit is contained in:
@@ -29,9 +29,9 @@ Future<void> setupFirebase(EnvironmentEnum env) async {
|
||||
// TODO(gdpr): wire `enabled` to real consent once the fix in backlog lands.
|
||||
final crashlytics = FirebaseCrashlyticsService(enabled: true);
|
||||
FlutterError.onError = (details) =>
|
||||
crashlytics.recordFlutterError(details, fatal: true);
|
||||
crashlytics.recordFlutterError(details, fatal: false);
|
||||
PlatformDispatcher.instance.onError = (error, stack) {
|
||||
crashlytics.recordError(error, stack, fatal: true);
|
||||
crashlytics.recordError(error, stack, fatal: false);
|
||||
return true;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
|
||||
import 'package:chat/chat.dart';
|
||||
import 'package:device_management/device_management.dart';
|
||||
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
@@ -359,6 +360,10 @@ void _handleNotificationNavigation(Map<String, dynamic> data) {
|
||||
|
||||
final command = resolved['command'] as String? ?? data['command'] as String?;
|
||||
|
||||
FirebaseCrashlytics.instance.log(
|
||||
'FCM-nav: command=$command from=$currentLocation',
|
||||
);
|
||||
|
||||
switch (command) {
|
||||
case 'ALERT':
|
||||
appRouter.go(AppRoutes.deviceNotifications);
|
||||
|
||||
Reference in New Issue
Block a user