TF-1289: [Data] Implement GetSubscription in fcm repository

This commit is contained in:
HuyNguyen
2022-12-29 17:03:25 +07:00
committed by Dat Vu
parent f71999ddfc
commit 5eb3a35046
2 changed files with 15 additions and 0 deletions
@@ -49,4 +49,13 @@ class FCMCacheManager {
return _fcmSubscriptionCacheClient.insertItem(
FCMSubscriptionCache.keyCacheValue, fcmSubscriptionCache);
}
Future<FCMSubscriptionCache> getSubscription() async {
final _fcmSubscription = await _fcmSubscriptionCacheClient.getItem(FCMSubscriptionCache.keyCacheValue);
if (_fcmSubscription == null) {
throw NotFoundSubscriptionException();
} else {
return _fcmSubscription;
}
}
}