NotificationFeedRequest class

A request object for fetching notification feed items.

Android Reference: NotificationFeedRequest

Uses cursor-based pagination matching Android SDK behavior:

  • First fetch: no cursor (fetches first page)
  • Subsequent fetches: cursor from previous response
  • Stops when server returns no cursor (returns empty list)

Example:

final request = (NotificationFeedRequestBuilder()
  ..setLimit(20)
  ..setReadState(FeedReadState.unread)
  ..setCategory('promotions'))
  .build();

final items = await request.fetchNext(
  onSuccess: (items) => print('Got ${items.length} items'),
  onError: (e) => print('Error: ${e.message}'),
);

Properties

category → String?
Category filter.
final
channelId → String?
Channel ID filter.
final
dateFrom → String?
Date from filter (ISO 8601).
final
dateTo → String?
Date to filter (ISO 8601).
final
hashCode → int
The hash code for this object.
no setterinherited
limit → int?
Number of results to limit the query.
final
readState → FeedReadState?
Read state filter.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tags → List<String>?
Tags filter.
final

Methods

fetchNext({required dynamic onSuccess(List<NotificationFeedItem> feedItems)?, required dynamic onError(CometChatException excep)?}) → Future<List<NotificationFeedItem>>
Fetches the next page of notification feed items.
getCategory() → String?
Gets the category filter. Android Reference: NotificationFeedRequest.getCategory()
getChannelId() → String?
Gets the channel ID filter. Android Reference: NotificationFeedRequest.getChannelId()
getDateFrom() → String?
Gets the date from filter. Android Reference: NotificationFeedRequest.getDateFrom()
getDateTo() → String?
Gets the date to filter. Android Reference: NotificationFeedRequest.getDateTo()
getLimit() → int?
Gets the limit for feed items. Android Reference: NotificationFeedRequest.getLimit()
getReadState() → FeedReadState?
Gets the read state filter. Android Reference: NotificationFeedRequest.getReadState()
getTags() → List<String>?
Gets the tags filter. Android Reference: NotificationFeedRequest.getTags()
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaultLimit → const int
Default limit for the number of results.
maxLimit → const int
Maximum limit for the number of results.