OneSignal
Custom Push Origin Subdomain Demo

How does this demo work?

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:

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.

How can I reset my state to test like a new user?

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.