TF-1217 Handle fcm message on foreground/background/terminate

This commit is contained in:
dab246
2022-11-23 15:14:37 +07:00
committed by Dat H. Pham
parent d73b2bc1be
commit 68fb9de326
13 changed files with 528 additions and 19 deletions
@@ -0,0 +1,47 @@
import 'package:fcm/model/type_name.dart';
import 'package:jmap_dart_client/jmap/account_id.dart';
import 'package:tmail_ui_user/features/base/action/ui_action.dart';
import 'package:jmap_dart_client/jmap/core/state.dart' as jmap;
class SynchronizeEmailOnForegroundAction extends FcmStateChangeAction {
final AccountId accountId;
SynchronizeEmailOnForegroundAction(
TypeName typeName,
jmap.State newState,
this.accountId
) : super(typeName, newState);
@override
List<Object?> get props => [typeName, newState, accountId];
}
class PushNotificationAction extends FcmStateChangeAction {
final AccountId accountId;
PushNotificationAction(
TypeName typeName,
jmap.State newState,
this.accountId
) : super(typeName, newState);
@override
List<Object?> get props => [typeName, newState, accountId];
}
class StoreEmailStateChangeToRefreshAction extends FcmStateChangeAction {
final AccountId accountId;
StoreEmailStateChangeToRefreshAction(
TypeName typeName,
jmap.State newState,
this.accountId
) : super(typeName, newState);
@override
List<Object?> get props => [typeName, newState, accountId];
}