3

Problem

I can't seem to find a reference a suggested way to implement sending notifications from a web server to an outlook add-in.

I've looked on:

Could you help me understand what's the best way to implement push notifications from web server -> outlook add-in?

Context

  • I personally would like to use Firebase Cloud Messaging, which depends on the Push API under the hood. Is the Push API supported?
  • WebSockets could also work, but here again I wasn't able to find something before working away on an implementation
p6l-richard
  • 321
  • 2
  • 11

2 Answers2

1

@nickromano is correct in that an add-in is just a webpage embedded in Outlook, so you may be able to send data to it through websockets or long polling outside of a standard request. However, this is not a supported use case scenario.

0

Web add-ins are not run all the time in Outlook. They are activated in reaction to any event or by users (for example, when a task pane is opened). Moreover, Outlook add-ins are working under the context of the currently selected item(s) only. So, your add-in should be activated if you want to receive any push notifications (by opening a task pane or any event).

Be aware, feature requests on Tech Community are considered, when the dev team go through the planning process. Use the github label: “Type: product feature request” at https://aka.ms/M365dev-suggestions .

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Thanks for the pointer. My question is actually when the add-in's context is live, how should/can I send push notifications to it? Not all browser APIs are supported, the [Notification API](https://github.com/OfficeDev/office-js/issues/2747) specifically didn't work in my case. – p6l-richard Aug 03 '22 at 17:32
  • Since it's just a webpage embedded in Outlook, if you're looking to communicate with your Addin while it's open you could use websockets or long polling to send data to the client outside of a standard request. If you don't have much experience setting that up in your backend you could always try an off-the-shelf solution like PubNub channels to play around with it. – nickromano Aug 09 '22 at 00:21