{"id":286,"date":"2023-09-04T22:05:49","date_gmt":"2023-09-04T20:05:49","guid":{"rendered":"https:\/\/dycrypt.dylanwettstein.com\/?page_id=286"},"modified":"2023-12-17T21:32:29","modified_gmt":"2023-12-17T20:32:29","slug":"notification","status":"publish","type":"page","link":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/","title":{"rendered":"Notification"},"content":{"rendered":"\n<p class=\"has-x-large-font-size\" style=\"font-style:normal;font-weight:800\">Enable push notifications<\/p>\n\n\n\n<p>After encrypting your file, enter the notification configuration ID you&#8217;ve received via E-Mail along with your E-Mail address to configure your device to receive push notifications for this file in addition to email notifications.<\/p>\n\n\n\n<p>This feature is optimized for Safari on iOS 16.4 and later. Other devices and browsers may work too, but using them is experimental and may not work reliably. Using the same notification configuration ID again will replace the initial device. Push notifications are sent once a file is decrypted or expires.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n    <div id=\"notification-support-check\">\n        <p id=\"support-result\">We don't support notifications on your browser.<br><br>If you're on an Apple device, please use the Safari web browser to enable notifications. Otherwise, please use Google Chrome.<\/p>\n    <\/div>\n\t<div id=\"form-container\">\n\t\t<form id=\"notification-form\" style=\"display:none;\">\n\t\t\t<div style=\"padding-bottom: 20px;\">\n\t\t\t\t<label for=\"activation-id\">Notification Configuration ID:<\/label><br>\n\t\t\t\t<input type=\"text\" id=\"activation-id\" name=\"activation-id\" style=\"font-family: Fractul; font-size: 12pt; width: 100%;\" required><br>\n\t\t\t<\/div>\n\t\t\t\t\n\t\t\t<div style=\"padding-bottom: 20px;\">\n\t\t\t\t<label for=\"email\">Email:<\/label><br>\n\t\t\t\t<input type=\"email\" id=\"email\" name=\"email\" style=\"font-family: Fractul; font-size: 12pt; width: 100%;\" required><br>\n\t\t\t<\/div>\n\t\t\t\n\t\t\t<div style=\"padding-bottom: 20px;\">\n\t\t\t\t<a href=\"#\" onclick=\"window.location.reload();\" style=\"color: #808080;\">reset form<\/a>\n\t\t\t<\/div>\n\n\t\t\t<input type=\"submit\" value=\"Request notification permissions\" id=\"submit-button\" class=\"wp-block-button__link wp-element-button\">\n\t\t<\/form>\n\t<\/div>\n    <script>\n\t\t\tvar supportResult = document.getElementById('support-result');\n\t\t\tvar registration;\n            var notifications_api_support = ('Notification' in window);\n            var is_ios_webapp = (window.navigator.standalone === true);\n            var touch = ('ontouchstart' in window || navigator.maxTouchPoints);\n            var is_safari = \/safari|applewebkit\/i.test(navigator.userAgent);\n            var is_chrome = \/chrome\/i.test(navigator.userAgent);\n\t\t\tvar form = document.getElementById('notification-form');\n            var userAgent = navigator.userAgent;\n            var iosVersionMatch = userAgent.match(\/Version\\\/(\\d+(\\.\\d+))\/);\n\t\t\tif(iosVersionMatch) {\n\t\t\t\tvar ios_version = parseFloat(iosVersionMatch[1]);\n\t\t\t}\n\t\t\tdocument.addEventListener('DOMContentLoaded', function() {\n\t\t\t  if ('serviceWorker' in navigator) {\n\t\t\t\tnavigator.serviceWorker.register('\/push\/service-worker.js')\n\t\t\t\t.then(function(reg) {\n\t\t\t\t\tregistration = reg;\n\t\t\t\t\tconsole.log('Push Service Worker registered');\n\t\t\t\t})\n\t\t\t\t.catch(function(error) {\n\t\t\t\t  console.error('Service Worker registration failed: ' + error);\n\t\t\t\t});\n\t\t\t  } else {\n\t\t\t\tconsole.warn('Service Worker is not supported.');\n\t\t\t  }\n\t\t\t});\n\t\t\t\n\t\t\tif (is_safari) {\n\t\t\t\tif (touch && ios_version !== null) {\n\t\t\t\t\tif (ios_version >= 16.4) {\n\t\t\t\t\t\tif (is_ios_webapp) {\n\t\t\t\t\t\t\tif (notifications_api_support) {\n\t\t\t\t\t\t\t\tsupportResult.textContent = 'Looks like we\\'re able to deliver Push notifications to this dycrypt web app. Enable them here:';\n\t\t\t\t\t\t\t\tform.style.display = 'block';\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tsupportResult.textContent = 'Notifications are not supported by your browser \u2013 even though they  should be. Please check your browser settings.';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsupportResult.innerHTML = 'Due to an iOS limitation, notifications can only be sent if you add dycrypt to your home screen. Please follow these simple instructions:<br><br>1. Press the share icon <img decoding=\"async\" src=\"https:\/\/dycrypt.dylanwettstein.com\/wp-content\/uploads\/2023\/09\/IMG_2812.png\" height=15pt> at the toolbar at the bottom.<br>2. Select \u00abAdd to Home Screen <img decoding=\"async\" src=\"https:\/\/dycrypt.dylanwettstein.com\/wp-content\/uploads\/2023\/09\/IMG_2814.png\" height=15pt>\u00bb<br>3. Press \u00abAdd\u00bb<br><br>Now open the just added dycrypt web app and navigate to \u00abEnable Notifications\u00bb.<br><br>If you\\'ve already added dycrypt to your home screen in the past, simply open the web app. You don\\'t need to add it a second time.';\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsupportResult.textContent = 'Your iOS version does not support web notifications. Please update to iOS 16.4 (or later) or use a different device.';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (notifications_api_support) {\n\t\t\t\t\t\tsupportResult.textContent = 'Enabling push notifications for this browser is experimental. To ensure reliability, consider using Safari on iOS 16.4 or newer.';\n\t\t\t\t\t\tform.style.display = 'block';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsupportResult.textContent = 'Your version of the Safari web browser appears to not support notifications. Please update your web browser or use a different device or browser.';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (is_chrome) {\n\t\t\t\tif (notifications_api_support) {\n\t\t\t\t\tsupportResult.textContent = 'Enabling push notifications for this browser is experimental. To ensure reliability, consider using Safari on iOS 16.4 or newer.';\n\t\t\t\t\tform.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\tsupportResult.textContent = 'Your version of Google Chrome appears to not support notifications. Please update your web browser or use a different device or browser.';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsupportResult.innerHTML = 'We don\\'t support notifications on your browser.<br><br>If you\\'re on an Apple device, use Safari to enable notifications. Otherwise, try using Google Chrome.';\n\t\t\t}\n        \nform.addEventListener('submit', function(event) {\n    event.preventDefault();\n    \n    \/\/ Request permission\n    Notification.requestPermission().then(function(permission) {\n\t\tif (Notification.permission === 'granted') {\n\t\t\t\/\/ Disable form fields\n\t\t\tdocument.querySelectorAll('input').forEach(function(inputElem) {\n\t\t\t\tinputElem.disabled = true;\n\t\t\t});\n\n\t\t\t\/\/ Hide button\n\t\t\tvar submitButton = document.getElementById('submit-button');\n\t\t\tif (submitButton) {\n\t\t\t\tsubmitButton.style.display = 'none';\n\t\t\t}\n\n\t\t\t\/\/ F\u00fcge neuen Button f\u00fcr die Aktivierung der Benachrichtigungen hinzu\n\t\t\tvar newButton = document.createElement('button');\n\t\t\tnewButton.id = 'enable-notifications-button';\n\t\t\tnewButton.type = 'submit';\n\t\t\tnewButton.innerHTML = 'Use this device for notifications about this file';\n\t\t\tnewButton.className = 'wp-block-button__link wp-element-button';\n\t\t\tdocument.getElementById('form-container').appendChild(newButton);\n\n\t\t\t\/\/ Event-Listener for new button\n\t\t\tnewButton.addEventListener('click', function() {\n\t\t\t\t\/\/ Start subscription\n\t\t\t\tconsole.log('Subscribing\u2026');\n\t\t\t\tconsole.log('Registration:', registration);\n\n\t\t\t\ttry{\n\t\t\t\t\tregistration.pushManager.subscribe({\n\t\t\t\t\t\tuserVisibleOnly: true,\n\t\t\t\t\t\tapplicationServerKey: 'BDr1HB_Ykcb5dTDS43zPrzHqLQr1kuYIrYyc16Ihn2TC6M4zv5rvujQAjWdz1yJlospHD7jR22AzRmGb68ZSMBA'\n\t\t\t\t\t}).then(function(subscription) {\n\t\t\t\t\t\tconsole.log('Subscription Success');\n\n\t\t\t\t\t\t\/\/ Send subscription details to server\n\t\t\t\t\t\tvar xhr = new XMLHttpRequest();\n\t\t\t\t\t\txhr.open('POST', '\/wp-admin\/admin-ajax.php', true);\n\t\t\t\t\t\txhr.setRequestHeader('Content-Type', 'application\/x-www-form-urlencoded');\n\t\t\t\t\t\txhr.onload = function() {\n\t\t\t\t\t\t\tif (xhr.status === 200) {\n\t\t\t\t\t\t\t\tvar response = JSON.parse(xhr.responseText);\n        \n\t\t\t\t\t\t\t\tif (response.success && !response.error) {\n\t\t\t\t\t\t\t\t\talert('We will send a push notification to this device in addition to the E-Mail as soon as there is a relevant update to your file.');\n\t\t\t\t\t\t\t\t\twindow.location.reload();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\/\/ Zeigt den Fehler an, der vom Server zur\u00fcckgegeben wurde\n\t\t\t\t\t\t\t\t\talert(response.error);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\txhr.send('action=save_push_subscription_to_db&subscription=' + JSON.stringify(subscription) + '&activation_id=' + document.getElementById('activation-id').value + '&email=' + document.getElementById('email').value);\n\n\t\t\t\t\t}).catch(function(error) {\n\t\t\t\t\t\tconsole.error('Subscription Error: ' + error);\n\t\t\t\t\t\talert('An error occurred: ' + error);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tcatch(err){\n\t\t\t\t\talert('We encountered an error while trying to configure your browser to receive push notifications. Please try using another browser or device. This service is optimized for Safari on iOS 16.4 and later.');\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n            alert('Push permissions were denied by you or your browser settings. We can\\'t send push notifications without your permission.');\n        }\n    });\n});\n    <\/script>\n    \n","protected":false},"excerpt":{"rendered":"<p>Enable push notifications After encrypting your file, enter the notification configuration ID you&#8217;ve received via E-Mail along with your E-Mail address to configure your device to receive push notifications for this file in addition to email notifications. This feature is optimized for Safari on iOS 16.4 and later. Other devices and browsers may work too, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"blank","meta":{"footnotes":""},"class_list":["post-286","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Notification - dycrypt<\/title>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Notification - dycrypt\" \/>\n<meta property=\"og:description\" content=\"Enable push notifications After encrypting your file, enter the notification configuration ID you&#8217;ve received via E-Mail along with your E-Mail address to configure your device to receive push notifications for this file in addition to email notifications. This feature is optimized for Safari on iOS 16.4 and later. Other devices and browsers may work too, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/\" \/>\n<meta property=\"og:site_name\" content=\"dycrypt\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-17T20:32:29+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/index.php\\\/notification\\\/\",\"url\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/index.php\\\/notification\\\/\",\"name\":\"Notification - dycrypt\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#website\"},\"datePublished\":\"2023-09-04T20:05:49+00:00\",\"dateModified\":\"2023-12-17T20:32:29+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/index.php\\\/notification\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/index.php\\\/notification\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/index.php\\\/notification\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Notification\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#website\",\"url\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/\",\"name\":\"dycrypt\",\"description\":\"It&#039;s Your Data, Keep It That Way\",\"publisher\":{\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#organization\",\"name\":\"dycrypt\",\"url\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/IMG_5709.jpeg\",\"contentUrl\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/wp-content\\\/uploads\\\/2023\\\/08\\\/IMG_5709.jpeg\",\"width\":956,\"height\":237,\"caption\":\"dycrypt\"},\"image\":{\"@id\":\"https:\\\/\\\/dycrypt.dylanwettstein.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Notification - dycrypt","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Notification - dycrypt","og_description":"Enable push notifications After encrypting your file, enter the notification configuration ID you&#8217;ve received via E-Mail along with your E-Mail address to configure your device to receive push notifications for this file in addition to email notifications. This feature is optimized for Safari on iOS 16.4 and later. Other devices and browsers may work too, [&hellip;]","og_url":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/","og_site_name":"dycrypt","article_modified_time":"2023-12-17T20:32:29+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/","url":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/","name":"Notification - dycrypt","isPartOf":{"@id":"https:\/\/dycrypt.dylanwettstein.com\/#website"},"datePublished":"2023-09-04T20:05:49+00:00","dateModified":"2023-12-17T20:32:29+00:00","breadcrumb":{"@id":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/notification\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/dycrypt.dylanwettstein.com\/"},{"@type":"ListItem","position":2,"name":"Notification"}]},{"@type":"WebSite","@id":"https:\/\/dycrypt.dylanwettstein.com\/#website","url":"https:\/\/dycrypt.dylanwettstein.com\/","name":"dycrypt","description":"It&#039;s Your Data, Keep It That Way","publisher":{"@id":"https:\/\/dycrypt.dylanwettstein.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/dycrypt.dylanwettstein.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/dycrypt.dylanwettstein.com\/#organization","name":"dycrypt","url":"https:\/\/dycrypt.dylanwettstein.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/dycrypt.dylanwettstein.com\/#\/schema\/logo\/image\/","url":"https:\/\/dycrypt.dylanwettstein.com\/wp-content\/uploads\/2023\/08\/IMG_5709.jpeg","contentUrl":"https:\/\/dycrypt.dylanwettstein.com\/wp-content\/uploads\/2023\/08\/IMG_5709.jpeg","width":956,"height":237,"caption":"dycrypt"},"image":{"@id":"https:\/\/dycrypt.dylanwettstein.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/pages\/286","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/comments?post=286"}],"version-history":[{"count":17,"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/pages\/286\/revisions"}],"predecessor-version":[{"id":512,"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/pages\/286\/revisions\/512"}],"wp:attachment":[{"href":"https:\/\/dycrypt.dylanwettstein.com\/index.php\/wp-json\/wp\/v2\/media?parent=286"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}