SubscribeToPushNotificationsOnAllFolders method
Subscribes to push notifications on all folders in the authenticated user's mailbox. Calling this method results in a call to EWS.
The URL of the Web Service endpoint the Exchange server should push events to.
The frequency, in minutes, at which the Exchange server should contact the Web Service endpoint. Frequency must be between 1 and 1440.
An optional watermark representing a previously opened subscription.
The event types to subscribe to.
Implementation
Future<PushSubscription> SubscribeToPushNotificationsOnAllFolders(
Uri url,
int frequency,
String? watermark,
List<EventType> eventTypes,
) async {
EwsUtilities.ValidateMethodVersion(
this,
ExchangeVersion.Exchange2010,
"SubscribeToPushNotificationsOnAllFolders",
);
return (await BuildSubscribeToPushNotificationsRequest(
null,
url,
frequency,
watermark,
null,
null,
// AnchorMailbox
eventTypes,
).Execute())[0].Subscription!;
}