Web Push Notifications User Guide

(Difference between revisions)
Jump to: navigation, search
(Created page with "== Introduction == Web Push Notification is a new channel to engage users even after they left your website. It's very similar to mobile push notifications, but instead of re...")
 
(Hosted files)
Line 26: Line 26:
 
* '''sw.js'''
 
* '''sw.js'''
  
   importScripts("https://app.socialidnow.com/assets/api/sw.js");
+
   <nowiki>importScripts("https://app.socialidnow.com/assets/api/sw.js");</nowiki>
  
 
If you need to change the name and/or path for this file, be sure to specify it in the API initialization as described in [[socialid.webPush.init]].
 
If you need to change the name and/or path for this file, be sure to specify it in the API initialization as described in [[socialid.webPush.init]].

Revision as of 14:37, 17 January 2017

Contents

Introduction

Web Push Notification is a new channel to engage users even after they left your website. It's very similar to mobile push notifications, but instead of requiring users to download an app, they only have to accept the Web Push Notification permission on your website to be ready to receive notifications.

How to integrate

You can use Web Push Notifications as a new channel for your campaigns. However, prior to sending messages, you must ask your users for permission. We provide a set of Web Push Javascript APIs to make this process easier.

The only requirement for your website is that it must have HTTPS support, otherwise Web Push Notifications won't work for security reasons.

Hosted files

The next step is to host the following files in the root path of your website:

  • manifest.json
 {
   "name": "Example Name",
   "short_name": "ExampleShortName",
   "start_url": "/",
   "display": "standalone"
 }

You can set name and short_name entries to any other value that better identify your website. Notice that this file must have this exact name for the integration to work.

  • sw.js
 importScripts("https://app.socialidnow.com/assets/api/sw.js");

If you need to change the name and/or path for this file, be sure to specify it in the API initialization as described in socialid.webPush.init.

API keys

In order to use the Web Push Javascript APIs you'll need two keys that can be found in the Social-ID dashboard.

The first one is your Login App identifier, which is the same required for the Social Login integration.

The second one, specific for Web Push Notifications integration is the VAPID public key which can be found under the Call the API section of your Login App dashboard, as shown below.

Browser Support

Currently, Chrome and Firefox are supported.

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox