hex/ios/HEXMobile
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Ryan Vogel a5de693a2c
iOS: Hex's own recording mixes with other audio, and keyboard dictation asks paused audio to resume (#2151)
* iOS: Hex's own recording mixes with other audio with the Bluetooth mic too

Report (TestFlight build 56): voice input pauses a playing video and it
doesn't play again afterwards.

Hex's app capture, the warm session's keepalive and its captures already
used .playAndRecord with .mixWithOthers while Always use iPhone microphone
is on (the default). With it off (Bluetooth microphone allowed) they used
the non-mixable .record category, which interrupts another app's video or
music on activation, and the warm keepalive held that interrupting session
for the whole warm session. Both modes now use .playAndRecord in
.measurement mode with .mixWithOthers and A2DP output, never .duckOthers;
the Bluetooth mode adds .allowBluetoothHFP, so a headset's hands-free
microphone is still used (iOS routes HFP first when a device has both).

Removed: the '!int' (cannotInterruptOthers) retry in configureAudioSession.
It existed because the non-mixable .record session couldn't go active from
the background while another app played; it retried with exactly the
mixable Bluetooth options that are now used from the start, and a mixable
session never fails that way.

SystemAudioManager now takes its session through AudioSessionControlling
(AVAudioSession conforms), so tests can check the category and that ending
the session deactivates with .notifyOthersOnDeactivation (unchanged).

Verified: xcodebuild test on an iOS 27.2 iPhone 17 Pro simulator, 467
tests, 0 failures (with the next commit), including the new
AudioSessionSetupTests. The simulator has no inter-app audio
interruptions (a non-mixable .playback activation in one app left another
app's .playback audio playing, no notification), so whether video keeps
playing is for an iPhone to confirm.

* iOS: in-keyboard dictation asks the video or music it paused to resume

In-keyboard dictation records through WebKit (getUserMedia), whose audio
session lives in WebKit's GPU process. WebKit sets it to .playAndRecord in
.videoChat mode without .mixWithOthers (AudioSessionIOS::setCategory) and
deactivates it with setActive:NO withOptions:0 (AudioSessionCocoa), and
neither the page (navigator.audioSession only picks the category) nor a
WKWebView setting changes that. So it interrupts another app's video or
music when the capture starts and never tells it it may resume, which is
the report from TestFlight build 56. The keyboard's own setCategory with
.mixWithOthers and its setActive(false, .notifyOthersOnDeactivation) acted
on the keyboard process's session, which never went active, so they did
nothing for this. A native capture in the keyboard isn't an option: iOS
refuses recording to extensions.

Now the keyboard notes whether other audio was playing as a capture began
(isOtherAudioPlaying). When the capture ends (done, cancel, discard,
failure), 0.5 s later, once WebKit has let its session go and unless a new
capture is running, if nothing plays any more it activates its own
.playback session (nothing else plays, so it interrupts nothing) and
deactivates it with .notifyOthersOnDeactivation, off the main thread, for
players that resume on .shouldResume (InterruptedAudio). The video still
pauses while in-keyboard dictation records; only Hex's own recording (the
app and a warm session) can keep it playing. README and the start(...)
comment no longer say in-keyboard capture mixes.

Verified on an iOS 27.2 iPhone 17 Pro Max simulator on the Mac Studio, in
Safari with a looping MP4 playing: WebKit's log shows the keyboard's GPU
process setting PlayAndRecord/VideoChat and going active at the Hex key,
then AmbientSound and inactive at Done; with the other-audio check forced
on in a throwaway build, "asked the audio the capture interrupted to
resume" followed 0.5 s after WebKit's deactivation and dictation was
unaffected. The simulator has no inter-app interruptions and reports no
other audio playing, so the video never paused there before or after, and
the real build skips the request there. Whether iOS passes the resume on to
a player WebKit interrupted needs an iPhone. xcodebuild test: 467 tests,
0 failures, including testTheKeyboardAsksAudioItsCaptureStoppedToResume.
2026-11-21 06:58:47 +00:00
..
Assets.xcassets iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
zh-Hans.lproj iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00
AcknowledgementsView.swift iOS: never suggest slurs, and swear words only when asked (#2093) 2026-11-20 20:17:31 +00:00
AppleSpeechTranscriber.swift iOS: never ask for Speech Recognition, and slides from 123 show the key preview (#2109) 2026-11-20 23:04:26 +00:00
AppShortcuts.xcstrings iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00
AudioBackend.swift iOS: Hex's own recording mixes with other audio, and keyboard dictation asks paused audio to resume (#2151) 2026-11-21 06:58:47 +00:00
ContentView.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
CustomVocabularyEditor.swift iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00
DictationController+LaunchFixtures.swift iOS: split DictationController so dev passes the size check (#2066) 2026-11-20 11:42:45 -05:00
DictationController.swift iOS: text replacements without autocorrect, End with a period, and emoji and symbols on the Dictation bar (#2147) 2026-11-21 06:24:16 +00:00
EmojiSemanticIndex.swift iOS: emoji panel with on-device suggestions (Experiments › Emoji) (#2051) 2026-11-20 15:53:24 +00:00
FullKeyboardSnapshotStage.swift iOS: Polish keyboard, diacritic autocorrect, and a bilingual partner fix (#2143) 2026-11-21 04:43:47 +00:00
HexIntents.swift feat(ios): polish iPhone keyboard dictation, warm sessions, and Live Activity (#574) 2026-10-30 23:35:45 -07:00
HexLinks.swift iOS: privacy and support links in the app, Continue before the mic prompt, typing logs consent (#2063) 2026-11-20 16:23:37 +00:00
HEXMobile.entitlements Set up Hex Mobile internal TestFlight releases (#1997) 2026-11-19 11:48:49 -05:00
HEXMobileApp.swift iOS: Hinglish dictation, Hindi in Latin letters (Experiment, off by default) (#2119) 2026-11-21 00:29:24 +00:00
Info.plist iOS: plain permission prompts and no pre-prompt Allow button, for App Review (#2058) 2026-11-20 16:13:36 +00:00
KeyboardPreviewHost.swift iOS: fewer paste prompts, and a translate switch in the keyboard (#2134) 2026-11-21 03:24:58 +00:00
KeyboardSetup.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
KeyboardSpeechPreparation.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
LanguageSettingsRows.swift iOS: Hinglish dictation, Hindi in Latin letters (Experiment, off by default) (#2119) 2026-11-21 00:29:24 +00:00
LiveActivityCoordinator.swift iOS: fix six TestFlight tester issues (audio error, leaked error text, Live Activity, haptics, capitals, push to talk) (#2035) 2026-11-20 13:21:16 +00:00
Localizable.xcstrings iOS: text replacements without autocorrect, End with a period, and emoji and symbols on the Dictation bar (#2147) 2026-11-21 06:24:16 +00:00
Onboarding.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
OnboardingPieces.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
OnboardingProgress.swift iOS: onboarding follows the desktop flow (#2136) 2026-11-21 03:27:38 +00:00
ParakeetTranscriber.swift iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00
PrivacyInfo.xcprivacy iOS: version 1.0, iPhone only, privacy manifests (#2052) 2026-11-20 15:54:01 +00:00
SettingsComponents.swift iOS: Adaptive touch, personal key centres learned on device (Experiment, off by default) (#2146) 2026-11-21 06:13:04 +00:00
SettingsPages.swift iOS: text replacements without autocorrect, End with a period, and emoji and symbols on the Dictation bar (#2147) 2026-11-21 06:24:16 +00:00
TranscriptCleanup.swift iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00
TranslateDictationRow.swift iOS: fewer paste prompts, and a translate switch in the keyboard (#2134) 2026-11-21 03:24:58 +00:00
TypingInsightsView.swift iOS: Adaptive touch, personal key centres learned on device (Experiment, off by default) (#2146) 2026-11-21 06:13:04 +00:00
TypingLogsView.swift iOS: Simplified Chinese interface for the app, widgets and permission prompts (#2083) 2026-11-20 18:15:44 +00:00