Note: See the "yoursite.com" part of this demo here.
This site represents the "your-push-subdomain.yoursite.com" part of your custom push origin, composed of two major components:
http(s)://yoursite.com
, an iFrame to iframe.html
will be created.Users are actually subscribing to push notifications in a new window pointing to http(s)://your-custom-subdomain.yoursite.com/subscribe.html
.
From https://yoursite.com
, in order to query the subscription state, you need to open an iFrame to https://your-custom-subdomain.yoursite.com/iframe.html
. This is because only a page on the same origin as https://your-custom-subdomain.yoursite.com
is allowed to access origin-separated data storage like the push subscription token, notification permissions, and other kinds of site storage like cookies.
Please follow these instructions to wipe your site's storage and reset your notification permissions.
Be sure to close all existing tabs to this site after following those instructions, or simply restart your browser, to complete the reset process.
If you don't have a pre-assigned login, you can log in to this app's OneSignal dashboard with:
jason+webpushdemo@onesignal.com
123123123
You can paste this code below into the Developer Tools Console of this page, or click below.
You can attach simple data to each subscriber -- this can be viewed on our dashboard and used for segmentation when sending messages. Read our tagging guide to learn more.
Click below to tag yourself with some random data. You can view this on the All Users page of your dashboard.
If you're not automatically prompted, click below to Subscribe.
It looks like you've manually opted out of receiving notifications.
You can click the red notify button to opt-in again, or the button below.