Commit Graph

4124 Commits

Author SHA1 Message Date
Jose Olarte III
f23fe65078 docs(notifications): document debug panel auth settings and bypassAuth
Add doc/notification-debug-panel.md as the canonical panel reference.
Update ngrok guides, README, and analysis doc to describe independent
Backend URL, Test Mode, and Skip JWT Authentication settings, including
recommended configs for hosted test servers vs local ngrok.
2026-07-07 19:21:18 +08:00
Jose Olarte III
82380b3d35 fix(notifications): decouple JWT bypass from backend URL override
Add an explicit notificationDebug.bypassAuth setting (default off) so
custom backend URLs and test mode no longer skip authentication. Expose
the toggle in the Notification Debug Panel for local ngrok workflows;
hosted test servers receive JWT-authenticated requests by default.
2026-07-07 19:00:42 +08:00
Jose Olarte III
6a7f341990 docs(android): document Send Real WAKEUP_PING debug panel flow
Add §6 coverage for the full backend→FCM→refresh pipeline, expected
Logcat lines, and troubleshooting that distinguishes backend success
from end-to-end delivery; cross-link checklist, workflow, and §14.
2026-06-12 18:23:19 +08:00
Jose Olarte III
693bfacc1e feat(notifications): include refresh source in completion and failure logs
Thread options.source through logRefreshSuccess and logRefreshFailure so
WAKEUP_PING and debug-panel refreshes are grep-friendly end-to-end in
Logcat and the Event Log without changing refresh behavior.
2026-06-12 17:12:21 +08:00
Jose Olarte III
3d6ac2ab53 feat(dev): test full WAKEUP_PING pipeline from debug panel
Add Send Real WAKEUP_PING via /debug/send-wakeup and rename the local
refresh shortcut to Simulate WAKEUP_PING (Local).
2026-06-11 17:01:28 +08:00
Jose Olarte III
cd32895281 refactor(notifications): use clearApiNotifications and scheduleApiNotifications
Update the refresh replacement flow for the renamed plugin APIs and remove
the obsolete clearPredictiveNotifications type augmentation.
2026-06-09 19:39:50 +08:00
Jose Olarte III
a1f94300ad refactor(notifications): rename predictive terminology to API notifications
Update app logs, comments, and debug inspector labels to use API
notification wording while keeping clearPredictiveNotifications plugin
calls unchanged. Align the iOS pending-notification inspector with the
plugin's api_ identifier prefix.
2026-06-09 17:49:08 +08:00
Jose Olarte III
58b61471b5 fix(notifications): use clearPredictiveNotifications on refresh
Avoid cancelAllNotifications during schedule replacement so Daily
Reminder schedules are not cleared.
2026-06-08 19:42:48 +08:00
Jose Olarte III
55ef36be06 fix(notifications): send deviceId on refresh to match backend contract
The /notifications/refresh endpoint now requires deviceId or fcmToken.
Reuse the stable device ID from registration so refresh no longer returns 400.
2026-06-05 19:14:07 +08:00
Jose Olarte III
00abd5277f fix(dev): refresh Backend Status URL after save in debug panel
activeBackendUrl was a computed with no reactive deps, so it stayed stale
until the panel remounted. Use a ref and update it in syncBackendState().
2026-06-03 17:53:54 +08:00
Jose Olarte III
227ae85bb7 build(android): wire Capacitor Preferences and Firebase for push testing
Register @capacitor/preferences in the Android Capacitor project so
notification deviceId storage matches iOS. Replace the placeholder
google-services.json with the production Firebase client config for FCM.
Refresh package-lock after native sync / install.
2026-06-03 17:53:31 +08:00
Jose Olarte III
e0a3f7094f docs(notifications): add Android local ngrok testing guide
Add local-android-testing-ngrok.md for FCM wakeup, debug panel, Firebase
setup, platform/battery notes, troubleshooting, verification checklist, and
end-to-end QA flow. Add local-android-testing-analysis.md as planning
notes mapping reuse from the iOS ngrok guide.
2026-06-02 21:33:23 +08:00
Jose Olarte III
2dd76878ba build(ios): enable push and remote background notification capabilities
Add AppDebug.entitlements with development aps-environment for Debug builds, point Debug signing at it, and add remote-notification to UIBackgroundModes.
2026-05-27 17:26:33 +08:00
Jose Olarte III
4fb8f048cd build(ios): add GoogleService-Info.plist to Xcode resources
Also clarify the ngrok iOS guide steps for dragging the plist into the correct App folder/target.
2026-05-27 17:01:35 +08:00
Jose Olarte III
c97defef11 build(ios): add CapacitorPreferences pod for notification deviceId
Wire @capacitor/preferences into the iOS Capacitor Podfile so stable
deviceId persistence works on native builds. Refresh package-lock.json.
2026-05-25 17:06:07 +08:00
Jose Olarte III
2c0992ba8b docs(notifications): put Xcode workspace before Firebase in ngrok guide
Reorder first-time setup so Capacitor/Xcode workspace generation (section 4)
precedes Firebase and APNs steps that require Xcode. Update cross-links and
skip targets; no change to Firebase/APNs technical instructions.
2026-05-25 16:59:17 +08:00
Jose Olarte III
964cdb4509 docs(notifications): add from-scratch Firebase and APNs setup to ngrok guide
Document first-time FCM/APNs configuration (project, plist, .p8 key,
Admin credentials, Xcode capabilities) before the iOS build step, and
renumber later sections so the checklist references the new flow.
2026-05-24 17:33:01 +08:00
Jose Olarte III
656de5eba3 docs(notifications): clarify ngrok guide so backend starts once
Consolidate first-run backend setup in section 1 and reframe section 2
as verification only, so local iPhone testing does not look like two
separate startup steps.
2026-05-24 10:21:10 +08:00
Jose Olarte III
0d7586865c feat(notifications): allow auth bypass for local debug and ngrok testing
Add shouldBypassNotificationAuth() when test mode or a backend URL override
is set so register/refresh can proceed without DID/Bearer headers. Production
paths still require auth when bypass is off; log bypass vs authenticated
request modes for easier WAKEUP_PING and panel smoke testing.
2026-05-20 19:34:46 +08:00
Jose Olarte III
5bc030125a feat(notifications): defer FCM registration until auth is ready
Queue token registration when Bearer auth is unavailable at startup,
with bounded exponential backoff retries. Flush the pending token when
identity is set, the app resumes, or the native fetcher configures.
Skip refresh API calls when auth is missing and log lifecycle events
for registration wait and refresh skip.
2026-05-20 15:54:36 +08:00
Jose Olarte III
8cd8727a84 feat(notifications): authenticate register and refresh API calls
Use getHeaders(activeDid) for POST /notifications/register and
/notifications/refresh so requests include Authorization: Bearer tokens
like the rest of the app. Add notificationApiAuth helper for shared header
resolution, auth logging, and graceful handling when identity or token
is missing or the server returns 401/403.
2026-05-20 15:45:46 +08:00
Jose Olarte III
8864a2049b docs(notifications): add local iOS ngrok testing guide for wakeup service
Document Mac backend + ngrok + physical iPhone setup, debug panel overrides,
Firebase/APNs checklist, curl examples, and troubleshooting for WAKEUP_PING flows.
2026-05-18 21:22:53 +08:00
Jose Olarte III
63f5c4ecc7 feat(notifications): add structured observability for push wake and refresh flows
Introduce NotificationDebugEvents and [Notifications] console/panel logging for push
handlers, token registration, refresh timing, schedule replacement, and WAKEUP_PING.
2026-05-18 18:46:16 +08:00
Jose Olarte III
a4453c0b1b feat(dev): extend Notification Debug Panel for backend testing
Add backend URL, test mode, token re-register, refresh diagnostics, FCM token display,
and a capped event log; expose refreshNotificationsWithDiagnostics and reregisterFcmTokenNow.
2026-05-18 16:28:21 +08:00
Jose Olarte III
794b48f0d7 feat(notifications): add localStorage debug config for notification API base URL
Introduce NotificationDebugConfig so register/refresh use getNotificationApiBaseUrl()
(APP_SERVER by default, optional LAN/ngrok override) and configurable testMode without rebuilds.
2026-05-18 15:06:52 +08:00
Jose Olarte III
4c97c578bb fix(notifications): fall back when crypto.randomUUID is missing
If randomUUID is unavailable (older WebViews), generate a one-time ID
with Date.now + random segment, log a single DeviceId warning, and
persist it as before so registration still works.
2026-05-13 20:57:14 +08:00
Jose Olarte III
6a9f34a516 feat(notifications): persist stable deviceId for FCM registration
Add getOrCreateDeviceId() backed by Capacitor Preferences so one UUID
survives app restarts and token refreshes. Include deviceId in POST
/notifications/register alongside fcmToken, platform, and testMode.
Add @capacitor/preferences and lightweight DeviceId logs (no token/ID values).
2026-05-13 18:41:10 +08:00
Jose Olarte III
5a40075ab1 fix(dev): pending inspector stable times and refreshPending without nested busy
Expose wall-clock fire targets from the iOS NotificationInspector
(scheduled_time userInfo and predictive_<epochMs> ids) so the debug
panel is not misleading when nextTriggerDate resamples for interval
triggers. Extend TS types and show the scheduled target in the UI,
with a note when iOS nextTriggerDate diverges.

Make refreshPending a plain fetch so mock refresh, wakeup ping, flood
test, and clear notifications can refresh the pending list while an
outer withBusy guard is already active.
2026-05-11 13:50:52 +08:00
Jose Olarte III
48637ae9a8 docs(readme): document Notification Debug Panel for dev builds 2026-05-11 11:16:43 +08:00
Jose Olarte III
a55dce6f3d fix(dev): align notification debug with non-production Capacitor builds
Add includeDevToolkitRoutes (vite dev or MODE !== production) and use it
from the router, AccountViewView, and NotificationDebugView so the debug
screen matches dev-notifications registration after vite build.

Update the gated banner copy to refer to production Vite builds.
2026-05-08 20:02:34 +08:00
Jose Olarte III
d7d5e401b8 fix: dev notification debug on Capacitor and iOS compile
Register the dev-notifications route whenever the bundle is non-production
(DEV or Vite MODE !== production), matching the account screen so RouterLink
to Notification Debug does not throw after vite build.

Align AccountViewView isDev with that rule and document the coupling.

Add NotificationInspectorPlugin.swift to the App target compile sources so
AppDelegate can register the plugin.
2026-05-08 17:54:00 +08:00
Jose Olarte III
19427c2817 fix(account): avoid import.meta in AccountViewView template
Vue’s template compiler treats bindings as non-module JS, so
`import.meta.env.DEV` in `v-if` broke the Capacitor/Vite build.
Expose a readonly `isDev` from the script instead.
2026-05-08 16:34:17 +08:00
Jose Olarte III
d4ac0acd01 chore: bump @timesafari/daily-notification-plugin to 3.0.2 2026-05-08 16:31:52 +08:00
Jose Olarte III
1ef3f32b9e fix(dev): clarify Android pending inspector and harden debug entry guard
- Report UNIMPLEMENTED from Android NotificationInspector instead of empty pending
- Surface iOS-only inspector message in NotificationDebugPanel without noisy errors
- Gate Account debug link with import.meta.env.DEV and document intent
- Add architecture comments on NotificationDebugService, inspector plugin, and native exports
2026-05-07 20:40:09 +08:00
Jose Olarte III
fd0b8ce6d0 feat(dev): add notification debug panel and native pending inspector
Add a dev-only Notification Debug Panel at /dev/notifications for testing
predictive refresh and WAKEUP_PING without a backend.

- Gate route and Advanced Settings entry on import.meta.env.DEV
- NotificationDebugService drives mock refresh, flood test, clear, and
  wake simulation via existing handleCapacitorPushNotificationReceived and
  applyNotificationRefreshPayload (shared with refreshNotifications)
- Add NotificationInspector Capacitor plugin: iOS lists pending
  UNNotificationRequest identifiers and next trigger; Android stub returns
  empty pending for safe registration
2026-05-07 18:52:59 +08:00
Jose Olarte III
320e55912b fix(notifications): apply backend timestamps via scheduleNotifications API
Stop converting backend timestamps to HH:mm/recurring schedules and remove
createSchedule/updateSchedule reconciliation. After a successful refresh payload,
clear existing notifications and schedule exact timestamps via the plugin
scheduleNotifications API (with back-compat clear fallback) to prevent drift.
2026-05-06 17:56:55 +08:00
Jose Olarte III
6bbade2a29 feat(notifications): refresh on mount and resume with debounce
Trigger refreshNotifications on composable mount and document resume, using a
debounced/in-flight guarded wrapper to avoid rapid duplicate refresh calls.
Expose the debounced refresh function from useNotifications.
2026-05-06 17:11:10 +08:00
Jose Olarte III
1cd329c720 fix(notifications): clear scheduled notifications before refresh apply
Cancel all native notifications before applying the backend-provided schedule so
refreshNotifications always performs a full replacement and never leaves stale
entries behind.
2026-05-06 16:45:56 +08:00
Jose Olarte III
7c8ef284c2 feat(notifications): apply backend refresh schedule to native plugin
Update refreshNotifications to POST /notifications/refresh and map returned
nextNotifications timestamps to clockTime schedules, upserting them via the
DailyNotification schedule APIs (with deterministic IDs) after refreshing native
fetcher credentials.
2026-05-06 16:17:50 +08:00
Jose Olarte III
35a1b92559 feat(notifications): refresh native fetcher on WAKEUP_PING silent push
Add refreshNotifications (configureNativeFetcherIfReady) and
handleCapacitorPushNotificationReceived for data.type WAKEUP_PING; invoke from
Capacitor pushNotificationReceived without UI.
2026-05-06 16:04:01 +08:00
Jose Olarte III
c523c14d96 feat(notifications): register FCM tokens with backend
Add registerToken POST to /notifications/register (platform, testMode).
Call it from Capacitor registration and Firebase getToken with deduped
registerRetrievedToken; expose registerToken via barrel and useNotifications
as registerFcmToken.
2026-05-06 15:40:00 +08:00
Jose Olarte III
162158066f feat(notifications): initialize Firebase Messaging and Capacitor push on native
Add firebaseMessagingClient to ensure the Firebase app is created from VITE_FIREBASE_*,
wire PushNotifications (listeners, requestPermissions, register) before token work,
and call getMessaging/getToken/onMessage when firebase/messaging is supported. Hook
startup from main.capacitor and set PushNotifications presentationOptions in
capacitor.config. Depend on firebase and @capacitor/push-notifications.
2026-05-06 15:30:46 +08:00
Jose Olarte III
1643bab18b Merge branch 'notify-api_android' into notify-api 2026-04-23 16:08:05 +08:00
Jose Olarte III
ce078862e7 chore: sync package-lock and Podfile.lock (TimesafariDailyNotificationPlugin 3.0.1) 2026-04-20 17:44:00 +08:00
Jose Olarte III
b9f19d3898 fix(notifications): set dual-schedule fallbackBehavior to skip
Avoid showing default New Activity copy when dual content is missing or
outside contentTimeout, per PLUGIN_NOTIFICATION_FIX_ANDROID.md.
2026-04-16 21:21:37 +08:00
Jose Olarte III
24957e0c6f docs(notifications): add Android plugin handout for empty-fetch dual schedule
Document PLUGIN_NOTIFICATION_FIX_ANDROID diagnosis and recommended changes in
the daily-notification-plugin repo, verified against plugin 3.0.0.
2026-04-10 21:12:11 +08:00
Jose Olarte III
954500cf9d fix(ios): static SQLCipher pods, strip system SQLite, refresh deps
- Podfile: use static frameworks; post_install/post_integrate hooks to
  avoid mixing Apple libsqlite3/SQLite headers with SQLCipher (including
  stripping aggregate Pods-App xcconfig flags for Swift explicit modules).
- Xcode: enable CLANG_ENABLE_MODULES; replace CocoaPods “Embed Pods
  Frameworks” phase with “Copy Pods Resources”; minor project file hygiene.
- Pods: SQLCipher 4.10.0, ZIPFoundation patch bump; Podfile.lock updated.
- package.json: allow patch updates for @capacitor-community/sqlite (^6.0.2);
  regenerate package-lock.json.
- Info.plist: reorder keys only (same URL scheme, background modes, BG tasks,
  notification alert style).
2026-04-09 21:46:32 +08:00
Jose Olarte III
73d595046a docs(readme): expand Setup & Building quick start for all platforms
Restructure the quick start with Web, Android, and iOS subheadings; put
each npm command in its own code block; fold the test-page step into the
Web section. Document Android (build:android:test:run + ADB, link to
BUILDING.md) and iOS (build:ios:studio + Xcode prerequisites).
2026-04-02 19:03:58 +08:00
Jose Olarte III
cf9d207895 fix(ios): make build-ios.sh work on current simulators and trim xcodebuild noise
Use generic/platform=iOS Simulator instead of a fixed device name so CLI builds
do not fail when that simulator is not installed (e.g. newer Xcode runtimes).

Pass -quiet to xcodebuild and enable SWIFT_SUPPRESS_WARNINGS plus
GCC_WARN_INHIBIT_ALL_WARNINGS for scripted builds and IPA archive/export so
terminal output stays smaller; full diagnostics remain available in Xcode.
2026-04-02 19:03:58 +08:00
Jose Olarte III
7d87a746f9 feat(ios): register Swift TimeSafariNativeFetcher for New Activity notifications
Add TimeSafariNativeFetcher (plansLastUpdatedBetween parity with Android) and
call DailyNotificationPlugin.registerNativeFetcher from AppDelegate before JS
configureNativeFetcher; broaden DailyNotificationDelivered scheduled_time types
in willPresent. Wire the new file into the App target; normalize PBX object IDs
to 24-char hex.

Document plugin ≥3 handoff (consuming-app-handoff-ios-native-fetcher-chained-dual),
refresh iOS/Android parity and notification-from-api-call file tables.
2026-04-02 19:02:48 +08:00