Socialid.webPush.subscribe

From Social ID Developers
Jump to: navigation, search

Contents

Description

Subscribes the user for receiving Web Push Notifications.

Usage

 socialid.webPush.subscribe(handler)

Parameters

handler optional A callback function to handle the subscribe response.

API Response

status The API response status. Can be success, if the user granted Web Push Notification permission and the subscription was successfully saved, or an error status otherwise. Notice that if the user deny the permission, an error will be shown instead and the handler won't be called.

Example

 socialid.webPush.subscribe(function(response) {
   if (response.status == "success") {
     alert("You have been subscribed successfully!");
   } else {
     alert("Could not subscribe you.");
   }
 });
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox