TF-1289: [Data] implement storeSubscription in fcm datasource
This commit is contained in:
@@ -19,6 +19,7 @@ import 'package:tmail_ui_user/features/mailbox/data/model/mailbox_rights_cache.d
|
||||
import 'package:tmail_ui_user/features/mailbox/data/model/state_cache.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox/data/model/state_type.dart';
|
||||
import 'package:tmail_ui_user/features/mailbox_dashboard/data/model/recent_search_cache.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/model/fcm_subscription.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/model/email_address_hive_cache.dart';
|
||||
import 'package:tmail_ui_user/features/thread/data/model/email_cache.dart';
|
||||
|
||||
@@ -118,6 +119,10 @@ class HiveCacheConfig {
|
||||
RecentLoginUsernameCacheAdapter(),
|
||||
CachingConstants.RECENT_LOGIN_USERNAME_HIVE_CACHE_IDENTITY
|
||||
);
|
||||
registerCacheAdapter<FCMSubscriptionCache>(
|
||||
FCMSubscriptionCacheAdapter(),
|
||||
CachingConstants.FCM_SUBSCRIPTION_HIVE_CACHE_INDENTITY
|
||||
);
|
||||
}
|
||||
|
||||
void registerCacheAdapter<T>(TypeAdapter<T> typeAdapter, int typeId) {
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
import 'package:tmail_ui_user/features/caching/config/hive_cache_client.dart';
|
||||
import 'package:tmail_ui_user/features/push_notification/data/model/fcm_subscription.dart';
|
||||
|
||||
class FCMSubscriptionCacheClient extends HiveCacheClient<FCMSubscriptionCache> {
|
||||
|
||||
@override
|
||||
String get tableName => 'FCMSubscriptionCache';
|
||||
}
|
||||
@@ -13,4 +13,5 @@ class CachingConstants {
|
||||
static const int AUTHENTICATION_INFO_HIVE_CACHE_IDENTIFY = 11;
|
||||
static const int RECENT_LOGIN_URL_HIVE_CACHE_IDENTITY = 12;
|
||||
static const int RECENT_LOGIN_USERNAME_HIVE_CACHE_IDENTITY = 13;
|
||||
static const int FCM_SUBSCRIPTION_HIVE_CACHE_INDENTITY = 14;
|
||||
}
|
||||
Reference in New Issue
Block a user