Skip to content

Ring shift alerts like a soft alarm instead of a single ping - #175

Merged
SishirP17 merged 1 commit into
mainfrom
feature/shift-alarm-sound
Jul 26, 2026
Merged

Ring shift alerts like a soft alarm instead of a single ping#175
SishirP17 merged 1 commit into
mainfrom
feature/shift-alarm-sound

Conversation

@SishirP17

Copy link
Copy Markdown
Collaborator

What

The 30-second pre-shift notification now rings like a soft alarm instead of playing the phone's default one-shot notification ping.

  • Bundles a synthesized 28 second ding-dong chime (assets/sounds/shift_alarm.wav) through the expo-notifications config plugin. iOS caps notification sounds at 30 seconds, so the chime rings for roughly the whole lead-in window.
  • Android: the sound plays on the ALARM audio stream, so it rings at the user's alarm volume (like their morning alarm) even when notification volume is turned down. Silent mode and DND still follow OS rules.
  • Android channels are immutable once created, so the sound change ships as a new shift-alerts-v2 channel. The old shift-alerts channel is deleted on the next ensureShiftAlertChannel() run so users don't see a stale duplicate in the app's notification settings.
  • iOS reads the sound from the notification content; same shift_alarm.wav is used there.

Notes

  • The custom sound needs a real build (the config plugin bundles the asset at prebuild). Expo Go falls back to the default notification sound; everything else keeps working.
  • Existing behavior is unchanged otherwise: tap still deep-links to the clock-in screen, foreground haptic tick still fires, alerts still cancel on logout.

Verification

  • npm run typecheck: clean
  • npm test: 15 files, 106 tests passed
  • npm run lint: clean
  • Sound asset audited: 16-bit PCM mono WAV, 28.0s, soft peak normalized

Bundle a 28 second synthesized chime (shift_alarm.wav) via the
expo-notifications config plugin and use it for the pre-shift alert on
both platforms. iOS caps notification sounds at 30s, so the chime rings
for roughly the whole 30 second lead-in window.

On Android the sound now plays through the ALARM audio stream, so it
rings at the user's alarm volume even when notification volume is down.
Android channels are immutable after creation, so this ships as a new
shift-alerts-v2 channel; the old channel is deleted on the next
ensureShiftAlertChannel() run.
@SishirP17
SishirP17 requested a review from durga710 as a code owner July 26, 2026 19:19
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rayhealth-evv-platform-app Ready Ready Preview, Comment Jul 26, 2026 7:21pm

@SishirP17
SishirP17 merged commit 2c730fa into main Jul 26, 2026
13 checks passed
@SishirP17
SishirP17 deleted the feature/shift-alarm-sound branch July 26, 2026 19:24
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.

1 participant