r/iOSProgramming • u/_harisamin • 24m ago
App Saturday [App Saturday] Dubkey: a voice translation keyboard. Mic capture and Foundation Models inside a keyboard extension
Dubkey is an iPhone keyboard.
You talk in your language and it types in the other person's, in any app. There's also a reply mode: copy their message, say your answer, and it replies in their language and tone. Free to try, $4.99 one-time unlock.
https://dubkey.app
https://apps.apple.com/app/id6840794248
Stack: Swift/SwiftUI, iOS 26+, XcodeGen. Keyboard extension with Full Access. SFSpeechRecognizer (on-device where the locale supports it) for transcription, Foundation Models for the rewrite, StoreKit 2, App Group for shared state, fastlane for 22 listing locales.
The interesting problem: audio in a keyboard extension. AVAudioEngineand AudioQueue don't work in the keyboard process, even with Full Access. The workaround, from stephancill/ios-keyboard-dictation (MIT), is a hidden 1×1 WKWebView that runs getUserMedia. WebKit captures in its own process, and the page streams 16 kHz PCM chunks back to Swift, which go to SFSpeechAudioBufferRecognitionRequest. Ugly, but it's held up fine.
The nice surprise: memory. Keyboards get roughly 60-70 MB before they're killed, and I assumed an LLM in there was hopeless. But LanguageModelSession runs inference in a system process, so the model doesn't count against the keyboard. I prewarm a session when the keyboard opens, and the first result streams quickly.
Smaller things: - On iOS 27, PrivateCloudComputeLanguageModel is an opt-in fallback for long input. It has a daily quota you can check without spending it (quotaUsage). - I expected Private Cloud to support more languages than on-device. It doesn't: same 15.
List here: https://dubkey.app/apple-intelligence-languages.html - .permissiveContentTransformations guardrails were necessary. The default guardrails refused ordinary messages surprisingly often when asked to translate them.
AI disclosure: AI-assisted. Built with Claude Code; the architecture, product decisions and on-device testing are mine. Happy to go deeper on any of it, or on getting a Full Access keyboard through review.
Fun Fact: This was the fastest I have gotten an app approved, less than 24 hours. I didn't think it was gonna get approved so quickly and was worried about using WKWebView in such a manner. But The ioSDevWeekly from a couple of weeks ago gave me some hope...and it worked! : https://iosdevweekly.com/issues/778/



