You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

1 lines
13 KiB

var w=Object.defineProperty;var y=(n,t,o)=>t in n?w(n,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[t]=o;var f=(n,t,o)=>y(n,typeof t!="symbol"?t+"":t,o);import{V as v,e as x,M as S,C as k,_ as C,g as h,h as N,i as l,j as e,k as r,H as g,w as q,F as P,x as I}from"./index-BLqts8WY.js";import{Q as T}from"./QuickNav-DgCyvgDx.js";import{au as O,a as A}from"./index-MyY_xqVN.js";import{P as M}from"./PushNotificationPermission-9Wf_h46a.js";import"./index-CsfPLOYu.js";var W=Object.defineProperty,$=Object.getOwnPropertyDescriptor,D=(n,t,o,s)=>{for(var i=s>1?void 0:s?$(t,o):t,d=n.length-1,u;d>=0;d--)(u=n[d])&&(i=(s?u(t,o,i):u(i))||i);return s&&i&&W(t,o,i),i};let m=class extends v{constructor(){super(...arguments);f(this,"$notify");f(this,"subscriptionJSON")}async mounted(){var o;try{const s=await((o=navigator.serviceWorker)==null?void 0:o.ready),i=await(s==null?void 0:s.pushManager.getSubscription());this.subscriptionJSON=i==null?void 0:i.toJSON()}catch(s){console.error("Mount error:",s)}}alertWebPushSubscription(){console.log("Web push subscription:",JSON.parse(JSON.stringify(this.subscriptionJSON))),alert(JSON.stringify(this.subscriptionJSON))}async sendTestWebPushMessage(o=!1){if(!this.subscriptionJSON){this.$notify({group:"alert",type:"danger",title:"Not Subscribed",text:"You must enable notifications before testing the web push."},-1);return}try{await O(this.subscriptionJSON,o),this.$notify({group:"alert",type:"success",title:"Test Web Push Sent",text:"Check your device for the test web push message"+(o?".":" if there are new items in your feed.")},-1)}catch(s){console.error("Got an error sending test notification:",s),this.$notify({group:"alert",type:"danger",title:"Error Sending Test",text:"Got an error sending the test web push notification."},-1)}}showTestNotification(){var s;const o="It Worked";(s=navigator.serviceWorker)==null||s.ready.then(i=>i.showNotification(o,{body:"This is your test notification."})).then(()=>{this.$notify({group:"alert",type:"success",title:"Sent",text:`A notification was triggered, so one should show on your device entitled '${o}'.`},5e3)}).catch(i=>{console.error("Got a notification error:",i),this.$notify({group:"alert",type:"danger",title:"Failed",text:"Got an error sending a notification."},-1)})}showNotificationChoice(){this.$refs.pushNotificationPermission.open(A,async(o,s,i)=>{o&&(await x.settings.update(S,{notifyingReminderMessage:i,notifyingReminderTime:s}),this.notifyingReminder=!0,this.notifyingReminderMessage=i||"",this.notifyingReminderTime=s)})}};m=D([k({components:{PushNotificationPermission:M,QuickNav:T}})],m);const R=""+new URL("chrome-install-pwa-DuUggvhZ.png",import.meta.url).href,F=""+new URL("mac-installed-app-settings-B9fFiuKk.png",import.meta.url).href,V=""+new URL("windows-system-enable-notifications-Dpjdl83C.png",import.meta.url).href,H={id:"Content",class:"p-6 pb-24 max-w-3xl mx-auto"},J={class:"mb-8"},E={class:"text-lg text-center font-light relative px-7"},G={href:"https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility",class:"text-blue-500",target:"_blank"},U={class:"px-2"},B={href:"https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility",class:"text-blue-500",target:"_blank"};function Y(n,t,o,s,i,d){const u=h("QuickNav"),p=h("fa"),b=h("PushNotificationPermission"),c=h("router-link");return I(),N(P,null,[l(u),e("section",H,[e("div",J,[e("div",E,[e("h1",{class:"text-lg text-center px-2 py-1 absolute -left-2 -top-1",onClick:t[0]||(t[0]=a=>n.$router.back())},[l(p,{icon:"chevron-left",class:"fa-fw"})])]),t[8]||(t[8]=e("h1",{id:"ViewHeading",class:"text-4xl text-center font-light pt-4 mb-8"}," Notification Help ",-1))]),e("div",null,[t[27]||(t[27]=e("p",null,"Here are ways to test notifications and get them working.",-1)),t[28]||(t[28]=e("h2",{class:"text-xl font-semibold mt-4"},"Full Test",-1)),e("div",null,[e("p",null,[t[9]||(t[9]=r(" If this works then you're all set. ")),e("button",{onClick:t[1]||(t[1]=a=>n.sendTestWebPushMessage(!0)),class:"block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mb-2"}," Send Yourself a Test Web Push Message (Through Push Server but Skipping Client Filter) ")])]),t[29]||(t[29]=e("h2",{class:"text-xl font-semibold mt-4"},"Android Users",-1)),t[30]||(t[30]=e("div",null,[e("p",null," Note that you may not receive notifications when the app is in the background. When you're done working, close the app, and then you'll get the reminder notifications. ")],-1)),t[31]||(t[31]=e("h2",{class:"text-xl font-semibold mt-4"}," If this app doesn't support notifications... ",-1)),t[32]||(t[32]=e("div",null,[e("p",null,[r(' To be notified of interesting updates, install this app on your device (as opposed to using it inside the browser app). In Chrome, it may prompt you, and you can also look for the "Install" command in the browser settings; on the the desktop, look for this icon in the address bar: '),e("img",{src:R,alt:"Chrome 'install' icon",class:"ml-4"})])],-1)),t[33]||(t[33]=e("h2",{class:"text-xl font-semibold mt-4"}," If you must enable notifications... ",-1)),e("div",null,[e("p",null,[e("button",{class:"text-blue-500",onClick:t[2]||(t[2]=a=>n.showNotificationChoice())}," Click here. "),l(b,{ref:"pushNotificationPermission"},null,512)])]),t[34]||(t[34]=g('<h2 class="text-xl font-semibold mt-4"> If you&#39;re waiting for system initialization... </h2><div><p> ... and it never stops, then there is a problem with the underlying service worker or push server mechanism in your browser. Your best bet is to follow the &quot;Reinstall&quot; steps below or use a different browser. </p></div><h2 class="text-xl font-semibold mt-4">Check App Permissions</h2><div><p> In Apple iOS, check &quot;Settings&quot; -&gt; &quot;Notifications&quot;, look for the Time Safari app (or the browser you&#39;re using), and make sure notifications are enabled. </p><p> In Android, hold on to the app icon, then select &quot;App Info&quot;, then &quot;Notifications&quot; and make sure they&#39;re enabled. If it&#39;s still a problem then go further: </p><p> If you installed the app with Chrome, make sure there are no other tabs with it open. Here are some ways to clear caches that can mess things up (and note that this clears out data from the installed app -- which is good to do while the app is installed): </p><ul><li class="list-disc ml-4"> Go to Chrome &quot;App Info&quot;, then &quot;Storage &amp; Cache&quot; and &quot;Clear Storage&quot;. </li><li class="list-disc ml-4"> Go to Chrome &quot;Settings&quot;, then &quot;Privacy and Security&quot; and &quot;Clear &quot;Clear browsing data&quot;, then &quot;Cookies and site data&quot;. Make sure the &quot;Time Range&quot; at the top shows &quot;All time&quot;. </li></ul><p> On a Mac, go to &quot;Settings&quot; and check &quot;Notifications&quot;. <img src="'+F+'" alt="Mac app settings" class="ml-4"></p></div><h2 class="text-xl font-semibold mt-4">Check Browser Permissions</h2>',5)),e("div",null,[t[11]||(t[11]=e("p",null,"In Apple iOS, check Settings -> Notifications.",-1)),t[12]||(t[12]=e("p",null,"In Android, check Settings -> Notifications.",-1)),t[13]||(t[13]=r(" You can find more details about compatibility ")),e("a",G,[t[10]||(t[10]=r(" here ")),l(p,{icon:"arrow-up-right-from-square",class:"fa-fw"})])]),t[35]||(t[35]=e("h2",{class:"text-xl font-semibold mt-4"}," Check Operating System (OS) Permissions ",-1)),e("div",U,[t[16]||(t[16]=g('<div><h3 class="text-lg font-semibold">Mobile Phone - Apple iOS</h3><div> Notifications require iOS 16.4 or higher. To check your iOS version, go to Settings &gt; General &gt; About &gt; Software Version. </div><h3 class="text-lg font-semibold">Mobile Phone - Google Android</h3><div> We recommend Chrome. It must be version 42 or higher. Check your version under Settings -&gt; About Chrome. </div><h3 class="text-lg font-semibold">Desktop - Mac</h3><div><span> See &quot;System Settings&quot; -&gt; &quot;Notifications&quot; and make sure it is enabled for the browser you&#39;re using. Note that these notifications require Mac OS 13; see your macOS version under Apple -&gt; &quot;About This Mac&quot;. </span></div><h3 class="text-lg font-semibold">Desktop - Windows</h3> In Windows, check &quot;Settings&quot; -&gt; &quot;Notifications&quot;. <img src="'+V+'" alt="Windows system settings" class="ml-4"></div>',1)),e("div",null,[t[15]||(t[15]=r(" You can find more details about compatibility ")),e("a",B,[t[14]||(t[14]=r(" here ")),l(p,{icon:"arrow-up-right-from-square",class:"fa-fw"})])])]),t[36]||(t[36]=e("h2",{class:"text-xl font-semibold mt-4"},"Reinstall",-1)),e("div",null,[t[19]||(t[19]=e("p",null," If all else fails, it's best to start over. ",-1)),e("p",null,[t[17]||(t[17]=r(" Of course, you'll want to back up all your data first -- all seeds as well as the contacts & settings -- on the Profile ")),l(p,{icon:"circle-user"}),t[18]||(t[18]=r(" page. "))]),t[20]||(t[20]=e("p",null," Here are instructions to uninstall the app and clear out caches and storage. Note that you should first ensure check that the browser tabs with Time Safari are closed. (If any are open then that will interfere with your refresh.) ",-1)),t[21]||(t[21]=e("ul",{class:"ml-4 list-disc"},[e("li",null,[r(" Clear cache. "),e("ul",null,[e("li",null,' In mobile, look for the browser app settings. This is true even for an installed app: go to the browser which you used to initially visit timesafari.app, because those settings affect the app. Look for "Delete browsing data" in the "Settings", under "Privacy and Security". '),e("li",null,' In Chrome, go to `chrome://settings/cookies` and "all site data and permissions" for timesafari.app; in Firefox, go to `about:preferences` and search for "cache" then "Manage Data" for timesafari.app. Also manually remove the IndexedDB data if the DBs still show.) ')])]),e("li",null,' Clear notification permission. (In Chrome, go to `chrome://settings/content/notifications`; in Firefox, go to `about:preferences` and search for "notifications".) '),e("li",null," Unregister service worker. (In Chrome, go to `chrome://serviceworker-internals/`; in Firefox, go to `about:serviceworkers`.) "),e("li",null,' Clear "Cache Storage". (In Chrome, in dev tools under "Application"; in Firefox, in dev tools under "Storage".) ')],-1)),t[22]||(t[22]=e("p",null,"Then reinstall the app.",-1))]),t[37]||(t[37]=e("h2",{class:"text-xl font-semibold mt-4"},"Tests",-1)),e("button",{onClick:t[3]||(t[3]=a=>n.showTestNotification()),class:"block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-4 mb-2"}," Send Test Notification Directly to Device (Not Through Push Server) "),t[38]||(t[38]=e("p",null,` If that didn't show a notification on your device, the problem is that your browser or your operating system are not allowing notifications through. See "Check App Permissions" and "Check Browser Permissions" and "Check Operating System (OS) Permissions" above. `,-1)),e("button",{onClick:t[4]||(t[4]=a=>n.alertWebPushSubscription()),class:"block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-4 mb-2"}," Show Web Push Subscription Info "),e("p",null,[t[23]||(t[23]=r(' If that showed "null" then the notification is not active. ')),e("button",{class:"text-blue-500",onClick:t[5]||(t[5]=a=>n.showNotificationChoice())}," Click here. ")]),e("button",{onClick:t[6]||(t[6]=a=>n.sendTestWebPushMessage(!0)),class:"block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-4 mb-2"}," Send Yourself a Test Web Push Message (Through Push Server but Skipping Client Filter) "),t[39]||(t[39]=e("p",null," If that didn't show a notification on your device, there is a problem getting to the push server. Disable notifications and then enable them again. ",-1)),e("button",{onClick:t[7]||(t[7]=a=>n.sendTestWebPushMessage()),class:"block w-full text-center text-md bg-gradient-to-b from-slate-400 to-slate-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-2 rounded-md mt-4 mb-2"}," Send Yourself a Test Web Push Message (Through Push Server and Client Filter) "),e("p",null,[t[25]||(t[25]=r(" If you don't see a message, it could be that there is nothing new for you to see. If the previous test worked, then things should work fine. If you notice a full 24 hours where you get no notification and you know that there are new items that should show, gather as many details as possible and go to the bottom of ")),l(c,{to:"help",class:"text-blue-500"},{default:q(()=>t[24]||(t[24]=[r(" this page ")])),_:1}),t[26]||(t[26]=r(" for ways to contact us. "))])])])],64)}const _=C(m,[["render",Y]]);export{_ as default};