TF-438 Handle show local notification when type is EmailDelivery on background or terminate
This commit is contained in:
@@ -3,16 +3,9 @@ import 'package:core/utils/app_logger.dart';
|
||||
import 'package:firebase_messaging/firebase_messaging.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/presentation/services/fcm_service.dart';
|
||||
|
||||
int semaphoreBackground = 0;
|
||||
|
||||
@pragma('vm:entry-point')
|
||||
Future<void> handleFirebaseBackgroundMessage(RemoteMessage message) async {
|
||||
if (semaphoreBackground != 0) {
|
||||
return;
|
||||
}
|
||||
semaphoreBackground = 1;
|
||||
Future.delayed(const Duration(milliseconds: FcmService.durationMessageComing)).then((_) => semaphoreBackground = 0);
|
||||
|
||||
log('FcmReceiver::handleFirebaseBackgroundMessage():messageId: ${message.messageId}');
|
||||
log('FcmReceiver::handleFirebaseBackgroundMessage(): ${message.data}');
|
||||
FcmService.instance.handleFirebaseBackgroundMessage(message);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user