Skip to content

Latest commit

 

History

History
89 lines (60 loc) · 5.18 KB

File metadata and controls

89 lines (60 loc) · 5.18 KB

Webhooks Notification Application Customizer

Summary

Sample SharePoint Framework application customizer showing how to leverage the SharePoint webhooks capabilities, in order to show toast notifications. The libraries used by this solution are Socket.io, sp pnp js, moment.

webhooks notification application customizer preview

Solution Architecture

Solution Architecture

Used SharePoint Framework Version

SPFx v1.3

Applies to

Solution

Solution Author(s)
react-application-webhooks-notification Giuliano De Luca (www.delucagiuliano.com, @giuleon)

Version history

Version Date Comments
1.0.0 November 05, 2017 Initial release

Disclaimer

THIS CODE IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.


Prerequisites

In order to use properly this solution is necessary follow these steps:

Minimal Path to Awesome

  • clone this repo
  • in the command line run
    • npm i
    • gulp serve --nobrowser
  • If you want to debug the solution append the following query string parameters to a moder page URL
    • Insert your Node JS app URL for the property WebhooksSocketServer
?loadSPFX=true&debugManifestsFile=https://localhost:4321/temp/manifests.js&customActions={"c0c009bd-5299-4c13-9826-9068022ce804":{"location":"ClientSideExtension.ApplicationCustomizer","properties":{"WebhooksSocketServer":"https://webhooksbroadcaster.azurewebsites.net"}}}
  • create a new item into the list Events if you have another modern page opened, you will see the toast notification (This obviously will happen for all client/employees with a modern page opened)

Deployment

In order to deploy the sample solution in a real environment, or at least in order to skip using the debug mode, you need to execute the following steps:

Features

The solution illustrates how to display toast notifications by receiving a webhook, every time that a new item is added to the list Events. Every user connected to the target site (Modern view) will be able to display a notification (Title and link) for ten seconds.

This sample illustrates the following concepts on top of the SharePoint Framework:

  • how to leverage the webhooks capabilities in order to display toast notifications
  • using React to build SharePoint Framework application customizers