feat: trigger notification provider refresh upon receiving FCM push notifications
This commit is contained in:
@@ -164,6 +164,9 @@ class PushNotificationService {
|
||||
}
|
||||
}
|
||||
|
||||
/// Callback to refresh notification count when FCM arrives
|
||||
void Function()? onNotificationReceived;
|
||||
|
||||
void _onForegroundMessage(RemoteMessage message) {
|
||||
debugPrint('[FCM] Foreground message: ${message.notification?.title}');
|
||||
|
||||
@@ -178,6 +181,9 @@ class PushNotificationService {
|
||||
return;
|
||||
}
|
||||
|
||||
// Refresh notification count immediately
|
||||
onNotificationReceived?.call();
|
||||
|
||||
// Show local notification on Android (iOS handles it natively)
|
||||
if (Platform.isAndroid) {
|
||||
_localNotifications?.show(
|
||||
|
||||
Reference in New Issue
Block a user