TF-439 Implement handle store device id

This commit is contained in:
dab246
2022-11-29 14:50:51 +07:00
committed by Dat H. Pham
parent 5103f5a94c
commit 21ec4bb071
10 changed files with 145 additions and 3 deletions
@@ -12,6 +12,8 @@ class FCMCacheManager {
final FcmTokenCacheClient _fcmTokenCacheClient;
final SharedPreferences _sharedPreferences;
static const String fcmDeviceIdKey = 'FCM_DEVICE_ID';
FCMCacheManager(this._fcmTokenCacheClient, this._sharedPreferences);
Future<FCMTokenDto> getFCMToken(String accountId) async {
@@ -69,4 +71,8 @@ class FCMCacheManager {
_sharedPreferences.remove(TypeName.emailDelivery.value)
]).then((listResult) => listResult.every((result) => result));
}
Future<bool> storeDeviceId(String deviceId) {
return _sharedPreferences.setString(fcmDeviceIdKey, deviceId);
}
}