From 47e4f36f97730ec5775206fbbedb3be6876bf1d3 Mon Sep 17 00:00:00 2001
From: Henry Heino <46334387+personalizedrefrigerator@users.noreply.github.com>
Date: Tue, 27 May 2025 09:20:31 -0700
Subject: [PATCH] Mobile: Allow recording to continue while the app is in the
background (#12330)
---
.../components/voiceTyping/AudioRecordingBanner.tsx | 2 ++
packages/app-mobile/ios/Joplin/Info.plist | 4 ++++
2 files changed, 6 insertions(+)
diff --git a/packages/app-mobile/components/voiceTyping/AudioRecordingBanner.tsx b/packages/app-mobile/components/voiceTyping/AudioRecordingBanner.tsx
index 95fe01ddd2..1306cc031c 100644
--- a/packages/app-mobile/components/voiceTyping/AudioRecordingBanner.tsx
+++ b/packages/app-mobile/components/voiceTyping/AudioRecordingBanner.tsx
@@ -100,6 +100,7 @@ const resetAudioMode = async () => {
// instead of the default one, so it's disabled when not recording:
allowsRecordingIOS: false,
playsInSilentModeIOS: false,
+ staysActiveInBackground: false,
});
};
@@ -129,6 +130,7 @@ const useAudioRecorder = (onFileSaved: OnFileSavedCallback, onDismiss: ()=> void
await Audio.setAudioModeAsync({
allowsRecordingIOS: true,
playsInSilentModeIOS: true,
+ staysActiveInBackground: true,
// Fixes an issue where opening a recording in the iOS audio player
// breaks creating new recordings.
// See https://github.com/expo/expo/issues/31152#issuecomment-2341811087
diff --git a/packages/app-mobile/ios/Joplin/Info.plist b/packages/app-mobile/ios/Joplin/Info.plist
index 5cb9128801..59a75c7ea1 100644
--- a/packages/app-mobile/ios/Joplin/Info.plist
+++ b/packages/app-mobile/ios/Joplin/Info.plist
@@ -118,5 +118,9 @@
NSFaceIDUsageDescription
$(PRODUCT_NAME) requires FaceID access to secure access to the application
+ UIBackgroundModes
+
+ audio
+