Skip to content

feat(wallet): add install banner and push notifications for incoming payments#1

Open
divysam wants to merge 1 commit into
mainfrom
feat/pwa-install-and-notifications
Open

feat(wallet): add install banner and push notifications for incoming payments#1
divysam wants to merge 1 commit into
mainfrom
feat/pwa-install-and-notifications

Conversation

@divysam

@divysam divysam commented May 26, 2026

Copy link
Copy Markdown
Owner

Summary

Closes Miracle656#171

Implements PWA install prompt and push notifications for incoming Stellar payments.

Changes

frontend/wallet/public/sw.js (new)

  • Custom service worker with background Horizon polling every 30 seconds
  • Fires showNotification() for each new incoming payment/create_account operation
  • Notification tap deep-links to /dashboard?tx=<hash>
  • Handles server-sent push events for future push subscription support
  • Listens for VEIL_REGISTER_ACCOUNT message from the page to know which account to poll

frontend/wallet/app/dashboard/page.tsx

  • Registers /sw.js and posts VEIL_REGISTER_ACCOUNT once wallet address is known
  • Requests Notification.requestPermission() once after first successful data load (guarded by veil_notif_asked localStorage key)
  • Handles ?tx=<hash> deep-link from notification tap — opens TxDetailSheet for the matching transaction

frontend/wallet/app/InstallBanner.tsx (pre-existing)

  • Already implemented and wired into app/layout.tsx
  • Shows on Android (uses beforeinstallprompt) and iOS (manual Share → Add to Home Screen instructions)
  • Dismissal stored in localStorage with 7-day cooldown; session-level suppression via sessionStorage

Acceptance criteria

  • Install banner appears on Android Chrome / iOS Safari before install
  • Banner doesn't reappear after dismissal (7-day cooldown)
  • Notifications fire for incoming testnet payments (SW polls Horizon every 30s)
  • Tapping a notification opens the relevant tx detail (/dashboard?tx=<hash>)
  • Graceful degradation when permission is denied (requestPermission catch is silent)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PWA install prompt and push notifications

1 participant