getFetcherForInstallation method

Future<BatchInboxFetcher> getFetcherForInstallation({
  1. int? maxPageSize,
  2. int? limit,
})

Get an inbox fetcher for the current installation ID.

The maxPageSize is the maximum of notifications to fetch on each call, up to 100 messages per page. Note that the actual count of fetched messages might differ from the value you've set here.

Set limit to be the maximum number of notifications to fetch, ever. This allows you to let Batch manage the upper limit itself, so you can be sure not to use a crazy amount of memory.

Implementation

Future<BatchInboxFetcher> getFetcherForInstallation(
    {int? maxPageSize, int? limit}) async {
  var fetcher = BatchInboxFetcherInstallationImpl();
  await fetcher.init(maxPageSize: maxPageSize, limit: limit);
  return fetcher;
}