diff --git a/lib/core/src/background_process/notifications_service.dart b/lib/core/src/background_process/notifications_service.dart index 518f0cac..640b768c 100644 --- a/lib/core/src/background_process/notifications_service.dart +++ b/lib/core/src/background_process/notifications_service.dart @@ -1,4 +1,5 @@ import 'package:background_fetch/background_fetch.dart'; +import 'package:moonchain_wallet/app/logger.dart'; import 'package:moonchain_wallet/core/core.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:mxc_logic/mxc_logic.dart'; @@ -48,20 +49,24 @@ class NotificationsService { final lowBatteryEnabled = periodicalCallData.lowBatteryEnabled; // Make sure user is logged in + print("isLoggedIn : $isLoggedIn, serviceEnabled : $serviceEnabled" ); if (isLoggedIn && MXCChains.isMXCChains(chainId) && serviceEnabled) { await MoonchainWalletNotification() .setupFlutterNotifications(shouldInitFirebase: false); + print('lowBalanceLimitEnabled: $lowBalanceLimitEnabled'); if (lowBalanceLimitEnabled) { await backgroundFetchConfigUseCase.checkLowBalance( account!, lowBalanceLimit); } + print('expectedTransactionFeeEnabled: $expectedTransactionFeeEnabled'); if (expectedTransactionFeeEnabled) { await backgroundFetchConfigUseCase .checkTransactionFee(expectedTransactionFee); } + print('expectedEpochOccurrenceEnabled: $expectedEpochOccurrenceEnabled'); if (expectedEpochOccurrenceEnabled) { periodicalCallData = await backgroundFetchConfigUseCase.checkEpochOccur( @@ -71,30 +76,38 @@ class NotificationsService { chainId); } + print('activityReminderEnabled: $activityReminderEnabled'); if (activityReminderEnabled) { await blueberryRingBackgroundNotificationsUseCase .checkActivityReminder(); } + print('sleepInsightEnabled: $sleepInsightEnabled'); if (sleepInsightEnabled) { await blueberryRingBackgroundNotificationsUseCase.checkSleepInsight(); } + print('heartAlertEnabled: $heartAlertEnabled'); if (heartAlertEnabled) { await blueberryRingBackgroundNotificationsUseCase.checkHeartAlert(); } + print('lowBatteryEnabled: $lowBatteryEnabled'); if (lowBatteryEnabled) { await blueberryRingBackgroundNotificationsUseCase.checkLowBattery(); } + print('periodicalCallData: ${periodicalCallData.toString()}'); backgroundFetchConfigUseCase.updateItem(periodicalCallData); BackgroundFetch.finish(taskId); } else { + print("Terminating background service because conditions doesn't meet" ); // terminate background fetch BackgroundFetch.stop(taskId); } - } catch (e) { + } catch (e, s) { + print("Background fetch ERROR : $e" ); + print("Background fetch stacktrace : $s" ); BackgroundFetch.finish(taskId); } } diff --git a/lib/core/src/firebase/moonchain_wallet_firebase.dart b/lib/core/src/firebase/moonchain_wallet_firebase.dart index 8dcbb052..f1217161 100644 --- a/lib/core/src/firebase/moonchain_wallet_firebase.dart +++ b/lib/core/src/firebase/moonchain_wallet_firebase.dart @@ -17,8 +17,7 @@ class MoonchainWalletFireBase { static int buildTap = 0; static Future initializeFirebase() async { - return await Firebase.initializeApp( - options: DefaultFirebaseOptions.currentPlatform); + return await Firebase.initializeApp(); } // Listening to the foreground messages diff --git a/pubspec.yaml b/pubspec.yaml index 5a40e484..da52429e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,7 +19,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.4.2 +version: 1.4.3 environment: @@ -51,7 +51,9 @@ dependencies: eth_sig_util: ^0.0.9 f_logs: ^2.0.1 favicon: ^1.1.2 - firebase_core: ^3.8.0 + firebase_analytics: ^11.3.6 + firebase_core: ^3.8.1 + firebase_crashlytics: ^4.2.0 firebase_messaging: ^15.1.5 fl_chart: ^0.69.0 fl_shared_link: @@ -66,7 +68,7 @@ dependencies: flutter_i18n: ^0.35.1 flutter_inappwebview: ^6.1.5 flutter_local_notifications: ^18.0.1 - flutter_mailer: ^2.0.2 + flutter_mailer: ^2.1.2 flutter_svg: ^2.0.1 geolocator: ^10.1.0 google_sign_in: ^6.1.5