markFeedItemAsDelivered static method
Future<void>
markFeedItemAsDelivered(
- NotificationFeedItem feedItem, {
- required dynamic onSuccess(
- void result
- required dynamic onError(
- CometChatException excep
Marks a single NotificationFeedItem as delivered.
Android Reference: CometChat.markFeedItemAsDelivered(NotificationFeedItem)
This operation is idempotent — calling multiple times has no side effects.
Delegates to NotificationFeedRepository.markDelivered.
@param feedItem The NotificationFeedItem to mark as delivered. @param onSuccess Callback invoked on successful delivery marking. @param onError Callback invoked if an error occurs.
Implementation
static Future<void> markFeedItemAsDelivered(NotificationFeedItem feedItem,
{required Function(void result)? onSuccess,
required Function(CometChatException excep)? onError}) async {
try {
final sdk = SdkRegistry.getInstance();
await sdk.notificationFeed.markDelivered(feedItem.id);
if (onSuccess != null) onSuccess(null);
} on SdkException catch (sdkEx) {
final cometChatEx = CometChatException(
sdkEx.code,
sdkEx.details ?? sdkEx.message,
sdkEx.message,
);
_errorCallbackHandler(cometChatEx, null, null, onError);
} catch (e) {
_errorCallbackHandler(null, null, e, onError);
}
}