Web Push Examples

May 15, 2020
Posted on May 15, 2020   |   Development

This guide shares commonly asked for code examples for theOneSignal Web Push SDK methods. Such as:

Custom Code Initialization

How to initialize OneSignal with Custom Code Setup


For Custom Code Setup only

Skip this section if using the Typical Setup or Site Builder (Wordpress) setup.

IMPORTANT Setup Instructions

1. Do not host OneSignalSDK.js yourself, use our CDN URL instead.

2 Add your appid which is found in Keys & IDs.

3. Make sure your URL is spelled correctly. Do not include www in the URL if your site does not use it. Also do include www in the URL if your site does use it.

We'd love to hear about your project Start New Projects