TF-1289: [Data] Implement DestroySubscription in fcm datasource

This commit is contained in:
HuyNguyen
2022-12-29 18:01:57 +07:00
committed by Dat Vu
parent 37e7013dd5
commit 5219cd4b69
4 changed files with 19 additions and 1 deletions
@@ -68,4 +68,9 @@ class CacheFCMDatasourceImpl extends FCMDatasource {
_exceptionThrower.throwException(error);
});
}
@override
Future<bool> destroySubscription(String subscriptionId) {
throw UnimplementedError();
}
}
@@ -58,4 +58,13 @@ class FcmDatasourceImpl extends FCMDatasource {
Future<FCMSubscriptionCache> geSubscription() {
throw UnimplementedError();
}
@override
Future<bool> destroySubscription(String subscriptionId) {
return Future.sync(() async {
return await _fcmApi.destroySubscription(subscriptionId);
}).catchError((error) {
_exceptionThrower.throwException(error);
});
}
}