Install
openclaw skills install ios-keyboard-limitationsiOS keyboard extension technical limitations and workarounds. Use when planning or building iOS custom keyboards with voice/audio features, dictation, or system integration needs. Covers memory limits, sandbox restrictions, microphone access, app launching, and viable alternative architectures.
openclaw skills install ios-keyboard-limitationsWhen building iOS custom keyboards with voice/audio features, these are the hard limitations discovered through the PolyVoice project.
Keyboard extensions cannot access the microphone.
AVAudioRecorder will fail with permission errorSFSpeechRecognizer is unavailableWhy: Apple security model — keyboards run in sandbox and could keylog audio.
Keyboards cannot programmatically open the main app or any other app.
UIApplication.shared.open() returns falsemyapp://) ExtensionContext.open() not availableWhy: Prevents malicious keyboards from launching apps without user consent.
Keyboard extensions have strict memory limits (~30-60MB).
Mitigation:
UserDefaults unavailable, only App Groups.
UserDefaults doesn't persistUserDefaults(suiteName: "group.com.company.app")API calls fail without user enabling "Allow Full Access" in Settings.
Goal: Let user tap a button to open main app for recording.
Attempt:
// This does NOT work
extensionContext?.open(URL(string: "myapp://record")!)
Reality: Must use UIApplication.shared.open() outside extension context, but keyboards can't call this.
What actually works (with friction):
User flow:
Keyboard → Tap mic → [Manual: Switch to app] → App auto-records →
[Manual: Switch back] → Keyboard auto-pastes
Friction points:
Use Share Sheet instead of keyboard.
Limitation: Not a keyboard — user must open share sheet per text field.
Don't use keyboard extension — use main app only.
Benefit: No memory limits, full mic access, reliable.
Cost: More friction than keyboard.
Provide Siri Shortcuts for voice-to-text.
Limitation: Not instant, requires Siri setup.
| Approach | Mic Access | Memory | User Friction | Apple Approved |
|---|---|---|---|---|
| Keyboard extension | ❌ No | ⚠️ 50MB | Low (if no audio) | ✅ Yes |
| Keyboard + audio workaround | ❌ No | ⚠️ 50MB | 🔴 High | ✅ Yes |
| Share extension | ✅ Yes | ✅ Full | 🟡 Medium | ✅ Yes |
| Full app only | ✅ Yes | ✅ Full | 🟡 Medium | ✅ Yes |
| Siri Shortcuts | ✅ Yes | ✅ Full | 🟡 Medium | ✅ Yes |
For voice dictation/AI transcription:
For non-audio keyboards (emoji, translation, etc.):
Keyboard extension works great. Just avoid audio features.