SubscribeToGroupPushNotifications method
Subscribes to push notifications on a group mailbox. Calling this method results in a call to EWS.
The smtpaddress of the group mailbox to subscribe to.
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.
Optional caller data that will be returned the call back.
The event types to subscribe to.
Implementation
Future<PushSubscription> SubscribeToGroupPushNotifications(
String groupMailboxSmtp,
Uri url,
int frequency,
String? watermark,
String? callerData,
List<EventType> eventTypes,
) async {
final folderIds = <FolderId>[
FolderId.fromWellKnownFolderAndMailbox(
WellKnownFolderName.Inbox,
Mailbox.fromSmtpAddress(groupMailboxSmtp),
),
];
return (await BuildSubscribeToPushNotificationsRequest(
folderIds,
url,
frequency,
watermark,
callerData,
groupMailboxSmtp,
// AnchorMailbox
eventTypes,
).Execute())[0].Subscription!;
}