This guide shares commonly asked for code examples for theOneSignal Web Push SDK methods. Such as:
- Adding A Prompt Delay
- Location Tracking
- Delay Initialization Until Consent Provided For Data Privacy
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.
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.