Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote notification of Sharepoint 2010 update?

I have a business requirement from a client to generate push notifications to Apple devices based on changes to Sharepoint 2010 server. I need to support these notifications in nearly real-time and access a server that is behind a VPN.

I am stumped.

like image 278
whoblitz Avatar asked Oct 08 '22 14:10

whoblitz


1 Answers

You need to implement two things, an item event receiver that will detect the changes you are interested in and a APNS notification "service" to send the notification.

The standard way to react to changes in SharePoint is through event receivers. An event receiver implements a specific interface that provides callback functions for specific events.

There are multiple types of events all the way from the site collection level down to the item level. I assume that you are more interested in item level event receivers.

There are two broad types of events:

  • Before events (Adding,Changing,Deleting) are synchronous which means that the operation blocks until the event receiver finishes processing.
  • After events (Added, Changed, etc) are asynchronous and do not block the operation.

You should create an after event receiver that will create an APNS notification and send it.

To send the notification you can use a library like APNS-Sharp. The simplest solution would be to call the library directly from the event receiver. This may be OK if you are not concerned with notifications getting lost due to problems (e.g. connectivity).

A more robust and testable solution would be to put the notifications in a queue and create a separate project (eg. windows service, sharepoint service or even a simple scheduled task) that will read the queue and send the notifications.

like image 134
Panagiotis Kanavos Avatar answered Oct 11 '22 02:10

Panagiotis Kanavos