{"__v":11,"_id":"568c6de813c5ad0d00b34e4d","category":{"__v":11,"_id":"551ef4ef4986f62b00a7203e","pages":["551ef4f04986f62b00a7206d","551ef4f04986f62b00a7206e","551ef4f04986f62b00a7206f","552359b8e20da719000e797b","5536d74bc36ca60d003c5540","5548372bd2c8410d006c212d","55d77b86f662951900fc0ef5","5605b89024c9d80d001551fd","5668806406039e0d00c4ed24","56688887ee1dbf0d008f62a7","568c6de813c5ad0d00b34e4d","5699b35bcb127f0d003cc1ba","56cbe4638df25d0b00e8d774"],"project":"542b6018044e1e2200413772","version":"551ef4ef4986f62b00a7202e","reference":false,"createdAt":"2015-03-24T04:27:30.031Z","from_sync":false,"order":7,"slug":"website-push","title":"Website Push"},"parentDoc":null,"project":"542b6018044e1e2200413772","user":"55c146fdc0777c0d0046769d","version":{"__v":7,"_id":"551ef4ef4986f62b00a7202e","forked_from":"542b6018044e1e2200413775","project":"542b6018044e1e2200413772","createdAt":"2015-04-03T20:15:43.149Z","releaseDate":"2015-04-03T20:15:43.149Z","categories":["551ef4ef4986f62b00a7202f","551ef4ef4986f62b00a72030","551ef4ef4986f62b00a72031","551ef4ef4986f62b00a72032","551ef4ef4986f62b00a72033","551ef4ef4986f62b00a72034","551ef4ef4986f62b00a72035","551ef4ef4986f62b00a72036","551ef4ef4986f62b00a72037","551ef4ef4986f62b00a72038","551ef4ef4986f62b00a72039","551ef4ef4986f62b00a7203a","551ef4ef4986f62b00a7203b","551ef4ef4986f62b00a7203c","551ef4ef4986f62b00a7203d","551ef4ef4986f62b00a7203e","55d7f1879510f00d007ec727","56b94a5a9fc0de1700b60ae9","56bd0e48ac1c5c1900b2dbe4","56d74afc3eb4dd0b0020196a","5723ab8a1f41110e003081ed","576b4dd327d6252b00085422"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0"},"updates":[],"createdAt":"2016-01-06T01:29:12.434Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":11,"body":"Using push notifications on HTTPS websites allows extra features not available on HTTP websites.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"HTTPS Sites\"\n}\n[/block]\n- *Only works on HTTPS sites. If your site is HTTP, users cannot subscribe to notifications*\n- You can automatically prompt site visitors to subscribe to notifications\n    - To do this, set `autoRegister: true` in your `init()` method\n- Push notifications are seen as officially coming from your domain name\n- You can directly show the native browser prompt\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/l6qt1QuET6ycsIQkJfA3\",\n        \"chrome-https.jpg\",\n        \"1860\",\n        \"859\",\n        \"#b0605e\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"HTTP Sites\"\n}\n[/block]\n- *Works on both HTTP and HTTPS sites. If your site supports both protocols, use this option.*\n- Users can only be prompted to subscribe after clicking a button or link\n\n    Because web push notifications aren't actually supported for HTTP sites, we work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com.\n\n- Push notifications come from a subdomain of onesignal.com (see above)\n- Users must be shown a pop-up to subscribe\n\n    We show a pop-up because users are actually subscribing to push notifications from *subdomain*.onesignal.com instead of your domain.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/exmdUUD3REi98jJT9I7Q\",\n        \"chrome-http.jpg\",\n        \"1860\",\n        \"859\",\n        \"#3d598a\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How can I automatically prompt users to subscribe?\"\n}\n[/block]\nAutomatic prompting is only available for **HTTPS** sites.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://www.filepicker.io/api/file/VPv2mkH7RBy69BQ7REyu\",\n        \"https1.png\",\n        \"411\",\n        \"205\",\n        \"#28414e\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nHTTP sites do not support auto-prompting. Web push notifications actually do not support HTTP sites at all. We work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com. Due to browser restrictions, our workaround requires a popup to be shown, since users are actually subscribing to *subdomain*.onesignal.com.\n\nPlease note that users can never be subscribed automatically to push notifications, unless they have previously granted notification permissions to your site.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How can I use my own sending domain?\"\n}\n[/block]\nA custom sending domain is only possible for **HTTPS** sites.\n[block:html]\n{\n  \"html\": \"<img src=\\\"http://i.imgur.com/QT54slt.png\\\" style=\\\"background: url(http://i.imgur.com/QT54slt.png) no-repeat 0 0;\\tbackground-size: contain;\\theight: auto;\\tmax-width: 50%; margin: 0 auto; display: block;\\\"/>\"\n}\n[/block]\nHTTP sites must use a *subdomain*.onesignal.com sending domain. Web push notifications actually do not support HTTP sites at all. We work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com. This workaround is required because web push notifications are not actually supported on HTTP sites.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"How can I upgrade my site to HTTPS?\"\n}\n[/block]\nPlease [see these instructions for upgrading your site to HTTPS](https://documentation.onesignal.com/docs/guides-examples#switching-your-site-between-http-and-https-subscri).","excerpt":"","slug":"http-vs-https-features","type":"basic","title":"HTTP vs. HTTPS"}
Using push notifications on HTTPS websites allows extra features not available on HTTP websites. [block:api-header] { "type": "basic", "title": "HTTPS Sites" } [/block] - *Only works on HTTPS sites. If your site is HTTP, users cannot subscribe to notifications* - You can automatically prompt site visitors to subscribe to notifications - To do this, set `autoRegister: true` in your `init()` method - Push notifications are seen as officially coming from your domain name - You can directly show the native browser prompt [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/l6qt1QuET6ycsIQkJfA3", "chrome-https.jpg", "1860", "859", "#b0605e", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "HTTP Sites" } [/block] - *Works on both HTTP and HTTPS sites. If your site supports both protocols, use this option.* - Users can only be prompted to subscribe after clicking a button or link Because web push notifications aren't actually supported for HTTP sites, we work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com. - Push notifications come from a subdomain of onesignal.com (see above) - Users must be shown a pop-up to subscribe We show a pop-up because users are actually subscribing to push notifications from *subdomain*.onesignal.com instead of your domain. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/exmdUUD3REi98jJT9I7Q", "chrome-http.jpg", "1860", "859", "#3d598a", "" ] } ] } [/block] [block:api-header] { "type": "basic", "title": "How can I automatically prompt users to subscribe?" } [/block] Automatic prompting is only available for **HTTPS** sites. [block:image] { "images": [ { "image": [ "https://www.filepicker.io/api/file/VPv2mkH7RBy69BQ7REyu", "https1.png", "411", "205", "#28414e", "" ] } ] } [/block] HTTP sites do not support auto-prompting. Web push notifications actually do not support HTTP sites at all. We work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com. Due to browser restrictions, our workaround requires a popup to be shown, since users are actually subscribing to *subdomain*.onesignal.com. Please note that users can never be subscribed automatically to push notifications, unless they have previously granted notification permissions to your site. [block:api-header] { "type": "basic", "title": "How can I use my own sending domain?" } [/block] A custom sending domain is only possible for **HTTPS** sites. [block:html] { "html": "<img src=\"http://i.imgur.com/QT54slt.png\" style=\"background: url(http://i.imgur.com/QT54slt.png) no-repeat 0 0;\tbackground-size: contain;\theight: auto;\tmax-width: 50%; margin: 0 auto; display: block;\"/>" } [/block] HTTP sites must use a *subdomain*.onesignal.com sending domain. Web push notifications actually do not support HTTP sites at all. We work around the issue by sending notifications from a subdomain of our site, onesignal.com, which *is* an HTTPS site. You choose a subdomain to represent your site, and push notifications are officially sent from *subdomain*.onesignal.com. This workaround is required because web push notifications are not actually supported on HTTP sites. [block:api-header] { "type": "basic", "title": "How can I upgrade my site to HTTPS?" } [/block] Please [see these instructions for upgrading your site to HTTPS](https://documentation.onesignal.com/docs/guides-examples#switching-your-site-between-http-and-https-subscri).