Skip to content

fix(android): request POST_NOTIFICATIONS permission for background recording - #50

Merged
End2EndAI merged 3 commits into
mainfrom
feature/android-notifications-permission
Mar 30, 2026
Merged

fix(android): request POST_NOTIFICATIONS permission for background recording#50
End2EndAI merged 3 commits into
mainfrom
feature/android-notifications-permission

Conversation

@End2EndAI

@End2EndAI End2EndAI commented Mar 30, 2026

Copy link
Copy Markdown
Owner

Summary

  • Requests POST_NOTIFICATIONS runtime permission on Android 13+ before starting recording
  • Keeps the screen awake during recording using expo-keep-awake (deactivated on stop, cancel, or unmount)

Why

Background recording fix: On Android 13+, POST_NOTIFICATIONS is a runtime permission — declaring it in the manifest is not enough. The AudioRecordingService foreground service needs to show a notification to keep recording alive in the background. If the notification permission isn't granted, startForeground() silently fails and Android terminates the recording when the screen locks.

Keep awake: Prevents the screen from going to sleep mid-recording so users can monitor the timer and waveform. The user can still manually lock the device.

Test plan

  • Open the record screen on Android 13+ — system dialog should appear asking to allow notifications
  • Grant the permission, start recording, lock the screen — verify recording continues
  • Verify a "Recording audio" notification appears in the notification drawer during recording
  • Verify the screen stays on while recording without touching it
  • Verify the screen can sleep normally after stopping or cancelling recording

🤖 Generated with Claude Code

End2EndAI and others added 2 commits March 29, 2026 21:50
…ervice

Pass enableBackgroundRecording: true to the expo-audio config plugin so
it wires up the AudioRecordingService foreground service on Android.
Also add POST_NOTIFICATIONS permission required by the service notification.

Without the plugin option, enableBackgroundRecording defaults to false
and the recorder's useForegroundService flag is never set, so Android
kills the microphone when the screen turns off.

Requires a native rebuild — not deliverable via OTA update.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…cording

On Android 13+, POST_NOTIFICATIONS is a runtime permission. Without
requesting it explicitly, the foreground service notification cannot be
shown, causing Android to kill the recording when the screen locks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Mar 30, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
voicekeeper Ready Ready Preview, Comment Mar 30, 2026 5:05am

@github-actions

github-actions Bot commented Mar 30, 2026

Copy link
Copy Markdown

📱 Preview Update Ready

Branch: pr-50
Update: View on Expo

Scan to open in Expo Go

QR Code

Open the app on your device and scan this QR code, or open the Expo Go app and navigate to the update.

Activates keep-awake when recording starts and deactivates it on stop,
cancel, or screen unmount. Prevents the screen from sleeping mid-recording
while still allowing the user to manually lock the device.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@End2EndAI
End2EndAI merged commit 84b2c71 into main Mar 30, 2026
2 of 3 checks passed
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