history method

Retrieves a PaginatedResult object, containing an array of historical PresenceMessage objects for the channel, based on provided params.

If the channel is configured to persist messages, then presence messages can be retrieved from history for up to 72 hours in the past. If not, presence messages can only be retrieved from history for up to two minutes in the past.

Implementation

Future<PaginatedResult<PresenceMessage>> history([
  RealtimeHistoryParams? params,
]) async {
  final message = await invokeRequest<AblyMessage<dynamic>>(
    PlatformMethod.realtimePresenceHistory,
    {
      TxTransportKeys.channelName: _channel.name,
      if (params != null) TxTransportKeys.params: params
    },
  );
  return PaginatedResult<PresenceMessage>.fromAblyMessage(
    AblyMessage.castFrom<dynamic, PaginatedResult<dynamic>>(message),
  );
}