MOBILE PUSH NOTIFICATIONS
IndiPoli can send real-time push notifications to your browser — and via the browser’s background service worker, to your phone — whenever something meaningful happens: a trade is confirmed or fails, a new auto-mode opportunity crosses your probability threshold, or the killswitch is toggled.
Under the hood this is the standard Web Push API, protected by VAPID. No third-party push service. Your server is the sender.
1. GENERATE VAPID KEYS (ONE-TIME, OPERATOR STEP)
If you are self-hosting, you must create a VAPID keypair and put it in your
.env. If you are using someone else’s instance, skip to
step 2.
php scripts/generate-vapid.php
The script prints two lines — paste them into .env:
VAPID_PUBLIC_KEY=...
VAPID_PRIVATE_KEY=...
Keep the private key secret. The public key is embedded in every
authenticated page via <meta name="vapid-public-key"> and
sent to the browser during subscription.
Restart any running workers so they pick up the new environment.
2. ENABLE PUSH IN YOUR BROWSER
- Log in and go to /settings/account.
- Scroll to the Push notifications section.
- Click Enable push notifications.
- Your browser will prompt for permission. Click Allow.
- The button flips to Disable; the page shows “enabled on this device”.
From this point on, every significant notification IndiPoli emits will also arrive as a native browser push on this device, even if the tab is closed.
WHICH EVENTS TRIGGER A PUSH?
trade.confirmed— a CLOB order was accepted.trade.failed— a CLOB order was rejected or receipt verification failed.opportunity.created— a new auto-mode opportunity crossed the min-auto-probability threshold. (Manual-mode opportunities do not push — they’d spam.)killswitch.toggled— someone on your tenant (including you) flipped the killswitch.
MOBILE DEVICES
Add http://indipoli.test (or your public URL) to your phone’s
home screen from Chrome / Firefox / Safari. Once installed as a PWA-ish
shortcut, enable push from the Account settings tab inside the standalone
page. Push delivery then continues even when the shortcut is closed. iOS
Safari supports Web Push since 16.4 — make sure your iOS is up to date.
DISABLING
Click the Disable push notifications button in Account settings.
IndiPoli will unsubscribe the service worker and mark the subscription
revoked_at server-side — no future pushes will be sent to
that device. You can re-enable at any time (a fresh subscription will be
created).
HTTPS REQUIREMENT
Browsers only allow service workers and Web Push over HTTPS (or localhost).
On your Laragon dev machine http://indipoli.test is treated
as a secure origin. In production you must front IndiPoli
with TLS — self-signed certs will be rejected by most browsers for
service-worker registration.
TROUBLESHOOTING
- Permission denied forever. Browsers remember a denied permission. Open Site Settings → Notifications and reset to “Ask”, then click Enable again.
- Service worker not registering. DevTools → Application → Service Workers. Check for console errors during
/sw.jsfetch. - Subscribed but no push arriving. Check your server logs for
PushSendererrors. A 410 from the push endpoint means the subscription was revoked by the browser — it will be auto-pruned on the next send. - VAPID_PUBLIC_KEY missing from meta tag. The operator hasn’t run
generate-vapid.phpyet. See step 1.