diff --git a/mobile/scripts/ios-patch.sh b/mobile/scripts/ios-patch.sh index 20dd909..8008800 100644 --- a/mobile/scripts/ios-patch.sh +++ b/mobile/scripts/ios-patch.sh @@ -40,6 +40,17 @@ set_bool() { "$PB" -c "Add :$1 bool $2" "$PLIST" 2>/dev/null || "$PB" -c "Set :$ set_bool UIFileSharingEnabled true set_bool LSSupportsOpeningDocumentsInPlace true +# ── Keep CALL AUDIO alive when the app is BACKGROUNDED (minimised / screen locked) ────────────────── +# Without the 'audio' background mode, iOS suspends the WebView a few seconds after it backgrounds, which +# freezes the WebRTC mic + audio pipeline — so participants can't hear each other once the app is minimised +# or the phone locks. Declaring background audio keeps the audio session (and the app) running so a voice +# call continues in the background. (Video RENDERING still pauses while backgrounded — unavoidable in a +# WebView — but audio keeps flowing, which is what matters for a call.) Idempotent: rebuild the array each run. +"$PB" -c "Delete :UIBackgroundModes" "$PLIST" 2>/dev/null || true +"$PB" -c "Add :UIBackgroundModes array" "$PLIST" +"$PB" -c "Add :UIBackgroundModes:0 string audio" "$PLIST" +echo "UIBackgroundModes: audio (calls keep audio when minimised)" + # ── Custom URL scheme so the Share Extension can bounce the user back into the app ────────────────── # The extension stages the shared files into the App Group, then opens bizconnect://share; the app reads # the staged files and shows "Send to…". Registering the scheme is what makes that openURL succeed.