setMessagesReadStatus method

Future<List<EncryptedMessage>> setMessagesReadStatus(
  1. String sdkId,
  2. List<String> entityIds,
  3. int? time,
  4. bool readStatus,
  5. String? userId,
)

Implementation

Future<List<EncryptedMessage>> setMessagesReadStatus(String sdkId, List<String> entityIds, int? time, bool readStatus, String? userId) async {
	final res = await _methodChannel.invokeMethod<String>(
		'MessageApi.encrypted.setMessagesReadStatus',
		{
			"sdkId": sdkId,
			"entityIds": jsonEncode(entityIds.map((x0) => x0).toList()),
			"time": jsonEncode(time),
			"readStatus": jsonEncode(readStatus),
			"userId": jsonEncode(userId),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method setMessagesReadStatus");
	final parsedResJson = jsonDecode(res);
	return (parsedResJson as List<dynamic>).map((x1) => EncryptedMessage.fromJSON(x1) ).toList();
}