{"id":14349,"date":"2024-08-27T14:16:44","date_gmt":"2024-08-27T14:16:44","guid":{"rendered":"https:\/\/doc.stackposts.com\/?post_type=docs&#038;p=14349"},"modified":"2024-08-28T05:20:52","modified_gmt":"2024-08-28T05:20:52","slug":"https-websites","status":"publish","type":"docs","link":"https:\/\/doc.stackposts.com\/docs\/stackpush\/how-to-use\/integrate\/https-websites\/","title":{"rendered":"HTTPS Websites"},"content":{"rendered":"<h1><strong>Web Push for HTTPS Websites<\/strong><\/h1>\n<h2><strong>The sw.js file<\/strong><\/h2>\n<p>This setup guide is for HTTPS only websites. Please make sure that your website URL starts with https:\/\/<\/p>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-large aligncenter\" src=\"https:\/\/i.imgur.com\/1uHPyyo.png\" width=\"1297\" height=\"833\" \/><\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Step 1: Download the sw.js File<\/strong><\/h4>\n<p>Click on the link to download the sw.js file. Make sure to save it to a location on your computer where you can easily find it later, such as your Downloads folder or a specific project directory.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/i.imgur.com\/SQnyAGv.png\" width=\"369\" height=\"146\" \/><\/p>\n<h4><strong>Step 2: Upload the sw.js File to the Root Directory of Your Website<\/strong><\/h4>\n<p>Log in to your website\u2019s hosting account or access your server via FTP\/SFTP or a file manager provided by your hosting service. Once you have access to your website\u2019s files, locate the root directory of your website. The root directory is typically the main folder where your website\u2019s core files are stored, often named public_html, www, or similar.<\/p>\n<p>Use the upload feature in your file manager or drag and drop the sw.js file from your local machine into the root directory of your website. Confirm that the file has been successfully uploaded and appears in the directory.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/i.imgur.com\/JhImvei.png\" width=\"1206\" height=\"725\" \/><\/p>\n<h4><strong>Step 3: Insert the Provided Code into Your Website<\/strong><\/h4>\n<p><span style=\"color: #6b707f; font-weight: 400;\">Carefully copy the entire code snippet that you\u2019ve been provided. Ensure that there are no extra spaces or missing characters.<\/span> Paste the copied code into the chosen file at the correct location. If the instructions specify where to place the code, follow those directions closely. For example, it might be inserted just before the closing &lt;\/body&gt; tag.<\/p>\n<p>After pasting the code, save the changes to the file. If you\u2019re editing files directly on the server, this may happen automatically. If you\u2019re editing locally, ensure you upload the modified file back to the server, replacing the old version.<\/p>\n<p>Once the code is added and the files are saved, visit your website in a browser to ensure that everything is working as expected. Clear your browser cache if necessary to see the changes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-large aligncenter\" src=\"https:\/\/i.imgur.com\/dwuDmLV.png\" width=\"817\" height=\"672\" \/><\/p>\n<h2><strong>The manifest.json (iOS\/iPadOS Configuration)<\/strong><\/h2>\n<p>First, ensure that you have completed all the required fields below to generate the Manifest.json file. You can follow <strong><a href=\"https:\/\/doc.stackposts.com\/docs\/stackpush\/how-to-use\/integrate\/ios-and-ipados-for-safari\/\" target=\"_blank\" rel=\"noopener\">this guide<\/a><\/strong> to know the information that you need to config your manifest.json file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large\" src=\"https:\/\/i.imgur.com\/K2SpQSu.png\" width=\"1732\" height=\"856\" \/><\/p>\n<p>Upload the <strong>manifest.json<\/strong> to the Root Directory of Your Website like these steps above. Clear your browser cache if necessary to see the changes.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Web Push for HTTPS Websites The sw.js file This setup guide is for HTTPS only websites. Please make sure that your website URL starts with https:\/\/ &nbsp; Step 1: Download the sw.js File Click on the link to download the sw.js file. Make sure to save it to a location on your computer where you [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":14237,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"doc_badge":[],"class_list":["post-14349","docs","type-docs","status-publish","hentry","no-post-thumbnail"],"_links":{"self":[{"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/docs\/14349","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/comments?post=14349"}],"version-history":[{"count":14,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/docs\/14349\/revisions"}],"predecessor-version":[{"id":14403,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/docs\/14349\/revisions\/14403"}],"up":[{"embeddable":true,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/docs\/14237"}],"wp:attachment":[{"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/media?parent=14349"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/doc_tag?post=14349"},{"taxonomy":"doc_badge","embeddable":true,"href":"https:\/\/doc.stackposts.com\/wp-json\/wp\/v2\/doc_badge?post=14349"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}