SP.Web.registerPushNotificationSubscriber Method (sp.js)

Registers the subscriber for push notifications over the site. If the registration already exists, the service token is updated with the new value.

Applies to: apps for SharePoint | SharePoint Foundation 2013 | SharePoint Server 2013

SP.Web.registerPushNotificationSubscriber()

Parameters

  • deviceAppInstanceId
    Device app instance identifier.

  • serviceToken
    Token provided by the notification service to the device to receive notifications.

Return value

SP.PushNotificationSubscriber

Registered push notification subscriber.

Remarks

The serviceToken parameter must not be null. It must not be empty.

REST resource endpoint

See Web resource for more information.

Endpoint URI structure

http://<sitecollection>/<site>/_api/web/registerPushNotificationSubscriber(deviceAppInstanceId,serviceToken)

HTTP requests

This resource supports the following HTTP commands:

  • POST

POST syntax

POST http://<sitecollection>/<site>/_api/web/registerPushNotificationSubscriber(deviceAppInstanceId,serviceToken)

Resource parameters

  • deviceAppInstanceId

  • serviceToken