From e095568fbf3300cc5218b7c59bfb8ac33a4fe968 Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Sun, 7 Dec 2025 01:43:00 +0000 Subject: [PATCH] debug: add notification debug component to troubleshoot iOS --- app/layout.tsx | 2 ++ components/NotificationDebug.tsx | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 components/NotificationDebug.tsx diff --git a/app/layout.tsx b/app/layout.tsx index 664082a..63173ff 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,6 +3,7 @@ import './globals.css' import ServiceWorkerRegistration from '@/components/ServiceWorkerRegistration' import OfflineIndicator from '@/components/OfflineIndicator' import NotificationPrompt from '@/components/NotificationPrompt' +import NotificationDebug from '@/components/NotificationDebug' import { ToastProvider } from '@/components/ToastContainer' import ErrorBoundary from '@/components/ErrorBoundary' @@ -77,6 +78,7 @@ export default function RootLayout({ + {children} diff --git a/components/NotificationDebug.tsx b/components/NotificationDebug.tsx new file mode 100644 index 0000000..788ef06 --- /dev/null +++ b/components/NotificationDebug.tsx @@ -0,0 +1,29 @@ +'use client'; + +import { useEffect, useState } from 'react'; + +export default function NotificationDebug() { + const [debug, setDebug] = useState({}); + + useEffect(() => { + const info = { + notificationSupported: 'Notification' in window, + serviceWorkerSupported: 'serviceWorker' in navigator, + pushManagerSupported: 'PushManager' in window, + permission: 'Notification' in window ? Notification.permission : 'N/A', + localStorage: typeof localStorage !== 'undefined' ? localStorage.getItem('notification-prompt-dismissed') : 'N/A', + }; + setDebug(info); + }, []); + + return ( +
+
Push Debug:
+
Notification: {debug.notificationSupported ? '✓' : '✗'}
+
ServiceWorker: {debug.serviceWorkerSupported ? '✓' : '✗'}
+
PushManager: {debug.pushManagerSupported ? '✓' : '✗'}
+
Permission: {debug.permission}
+
Dismissed: {debug.localStorage || 'No'}
+
+ ); +}