OfficeDev / ews-java-api

A java client library to access Exchange web services. The API works against Office 365 Exchange Online as well as on premises Exchange.
MIT License
870 stars 560 forks source link

Push Notifications #554

Open bigalnz opened 8 years ago

bigalnz commented 8 years ago

Hello,

I am trying to copy the example for push notifications, and using the code here:

// Subscribe to push notifications on the Inbox folder, and only listen // to "new mail" events. PushSubscription pushSubscription = service.SubscribeToPushNotifications( new FolderId[] { WellKnownFolderName.Inbox }, new Uri("https://...") /* The endpoint of the listener. /, 5 / Get a status event every 5 minutes if no new events are available. /, null / watermark: null to start a new subscription. */, EventType.NewMail);

I get however two syntax errors: (1) new FolderId[] { WellKnownFolderName.Inbox }, // TYPE MISMATCH - WellKnownFolderId can not be converted FolderId (2) EventType.NewMail); // NEWMAIL CANNOT BE RESOLVED OR IS NOT A FIELD

Bugs or am I missing something?

jhd147350 commented 7 years ago

It puzzle me too. I cann't understand what is "the endpoint of the listener".

Yonysun commented 7 years ago

so easy... new FolderId[] { new FolderId(WellKnownFolderName.Inbox )}