diff --git a/lib/features/push_notification/presentation/controller/fcm_message_controller.dart b/lib/features/push_notification/presentation/controller/fcm_message_controller.dart index 4ac6f86fb..8684648db 100644 --- a/lib/features/push_notification/presentation/controller/fcm_message_controller.dart +++ b/lib/features/push_notification/presentation/controller/fcm_message_controller.dart @@ -54,10 +54,11 @@ class FcmMessageController extends PushBaseController { } void _listenBackgroundMessageStream() { - FcmService.instance.backgroundMessageStreamController - ?.stream - .debounceTime(const Duration(milliseconds: FcmUtils.durationMessageComing)) - .listen(_handleBackgroundMessageAction); + FcmService.instance.backgroundMessageStreamController?.stream + .debounceTime(const Duration( + milliseconds: FcmUtils.durationBackgroundMessageComing, + )) + .listen(_handleBackgroundMessageAction); } void _listenTokenStream() { diff --git a/lib/features/push_notification/presentation/utils/fcm_utils.dart b/lib/features/push_notification/presentation/utils/fcm_utils.dart index 74416fa4a..39b036311 100644 --- a/lib/features/push_notification/presentation/utils/fcm_utils.dart +++ b/lib/features/push_notification/presentation/utils/fcm_utils.dart @@ -33,6 +33,7 @@ class FcmUtils { ]; static const int durationMessageComing = 2000; static const int durationRefreshToken = 2000; + static const int durationBackgroundMessageComing = 30000; StateChange? convertFirebaseDataMessageToStateChange(Map dataMessage) { log('FcmUtils::convertFirebaseDataMessageToStateChange():dataMessage: $dataMessage');