subscribeToEvents method

Implementation

Future<EntitySubscription<EncryptedMessage>> subscribeToEvents(String sdkId, Set<SubscriptionEventType> events, BaseFilterOptions<Message> filter, EntitySubscriptionConfiguration? subscriptionConfig) async {
	final res = await _methodChannel.invokeMethod<String>(
		'MessageBasicApi.subscribeToEvents',
		{
			"sdkId": sdkId,
			"events": jsonEncode(events.map((x0) => SubscriptionEventType.encode(x0)).toList()),
			"filter": jsonEncode(BaseFilterOptions.encode(filter)),
			"subscriptionConfig": jsonEncode(subscriptionConfig == null ? null : EntitySubscriptionConfiguration.encode(subscriptionConfig!)),
		}
	);
	if (res == null) throw AssertionError("received null result from platform method subscribeToEvents");
	final parsedResJson = jsonDecode(res);
	return EntitySubscription(parsedResJson, (x0) => EncryptedMessage.fromJSON(x0));
}