From a3013ed6133a923c6bfa689e55790c0c2e5227bf Mon Sep 17 00:00:00 2001 From: Gabriel Grubba Date: Thu, 13 Aug 2026 17:55:50 -0300 Subject: [PATCH] UX: Enable WebRTC calls and background audio in the iOS webview - add 'audio' to UIBackgroundModes so webview audio (incl. WebRTC remote audio) keeps playing when the app is backgrounded or the screen locks, and PiP video can continue outside the app - update mic/camera usage descriptions to cover voice/video calls - allow media playback without a user gesture so remote call audio can start on joins/reconnects - grant in-webview capture permission for the site's own host to avoid repeated per-session prompts (OS-level prompts unaffected) - explicitly enable PiP and AirPlay for media playback --- ios/Discourse/Info.plist | 5 +++-- js/screens/WebViewScreenComponents/WebViewComponent.js | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ios/Discourse/Info.plist b/ios/Discourse/Info.plist index 7b7a260c..2f122bb5 100644 --- a/ios/Discourse/Info.plist +++ b/ios/Discourse/Info.plist @@ -83,11 +83,11 @@ NSCameraUsageDescription - Allows the app to upload images from your camera into a Discourse post. + Allows the app to use the camera for video calls on your Discourse sites, and to upload images from your camera into a Discourse post. NSLocationWhenInUseUsageDescription NSMicrophoneUsageDescription - Allows the app to upload audio and video into a Discourse post. + Allows the app to use the microphone for voice and video calls on your Discourse sites, and to upload audio and video into a Discourse post. NSPhotoLibraryUsageDescription Allows the app to upload images from your library into a Discourse post. NSUserActivityTypes @@ -105,6 +105,7 @@ UIBackgroundModes + audio fetch remote-notification diff --git a/js/screens/WebViewScreenComponents/WebViewComponent.js b/js/screens/WebViewScreenComponents/WebViewComponent.js index e957fe57..a561b7b8 100644 --- a/js/screens/WebViewScreenComponents/WebViewComponent.js +++ b/js/screens/WebViewScreenComponents/WebViewComponent.js @@ -194,6 +194,10 @@ class WebViewComponent extends React.Component { applicationNameForUserAgent={this.state.userAgentSuffix} allowsBackForwardNavigationGestures={true} allowsInlineMediaPlayback={true} + allowsPictureInPictureMediaPlayback={true} + allowsAirPlayForMediaPlayback={true} + mediaPlaybackRequiresUserAction={false} + mediaCapturePermissionGrantType={'grantIfSameHostElsePrompt'} allowsFullscreenVideo={true} allowsLinkPreview={true} hideKeyboardAccessoryView={!Platform.isPad}