subscribeToEvents method
Future<EntitySubscription<EncryptedTopic> >
subscribeToEvents(
- String sdkId,
- Set<
SubscriptionEventType> events, - BaseFilterOptions<
Topic> filter, - EntitySubscriptionConfiguration? subscriptionConfig,
Implementation
Future<EntitySubscription<EncryptedTopic>> subscribeToEvents(String sdkId, Set<SubscriptionEventType> events, BaseFilterOptions<Topic> filter, EntitySubscriptionConfiguration? subscriptionConfig) async {
final res = await _methodChannel.invokeMethod<String>(
'TopicBasicApi.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) => EncryptedTopic.fromJSON(x0));
}