subscribeToEvents method

Implementation

Future<EntitySubscription<EncryptedMessage>> subscribeToEvents(String sdkId, Set<SubscriptionEventType> events, FilterOptions<Message> filter, EntitySubscriptionConfiguration? subscriptionConfig) async {
	final res = await _methodChannel.invokeMethod<String>(
		'MessageApi.subscribeToEvents',
		{
			"sdkId": sdkId,
			"events": jsonEncode(events.map((x0) => SubscriptionEventType.encode(x0)).toList()),
			"filter": jsonEncode(FilterOptions.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));
}