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