TF-1289: [Data] Implement GetSubscription in fcm datasource
This commit is contained in:
@@ -17,4 +17,6 @@ abstract class FCMDatasource {
|
|||||||
Future<FirebaseSubscription> getFirebaseSubscriptionByDeviceId(String deviceId);
|
Future<FirebaseSubscription> getFirebaseSubscriptionByDeviceId(String deviceId);
|
||||||
|
|
||||||
Future<FirebaseSubscription> registerNewToken(RegisterNewTokenRequest newTokenRequest);
|
Future<FirebaseSubscription> registerNewToken(RegisterNewTokenRequest newTokenRequest);
|
||||||
|
|
||||||
|
Future<FCMSubscriptionCache> geSubscription();
|
||||||
}
|
}
|
||||||
@@ -59,4 +59,13 @@ class CacheFCMDatasourceImpl extends FCMDatasource {
|
|||||||
_exceptionThrower.throwException(error);
|
_exceptionThrower.throwException(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<FCMSubscriptionCache> geSubscription() {
|
||||||
|
return Future.sync(() async {
|
||||||
|
return await _firebaseCacheManager.getSubscription();
|
||||||
|
}).catchError((error) {
|
||||||
|
_exceptionThrower.throwException(error);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -53,4 +53,9 @@ class FcmDatasourceImpl extends FCMDatasource {
|
|||||||
Future<bool> storeSubscription(FCMSubscriptionCache fcmSubscriptionCache) {
|
Future<bool> storeSubscription(FCMSubscriptionCache fcmSubscriptionCache) {
|
||||||
throw UnimplementedError();
|
throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<FCMSubscriptionCache> geSubscription() {
|
||||||
|
throw UnimplementedError();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user