← 返回 Skills 市场
usimic

Ios Keyboard Limitations

作者 usimic · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
1008
总下载
0
收藏
1
当前安装
1
版本数
在 OpenClaw 中安装
/install ios-keyboard-limitations
功能描述
iOS 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.
使用说明 (SKILL.md)

iOS Keyboard Extension Limitations

When building iOS custom keyboards with voice/audio features, these are the hard limitations discovered through the PolyVoice project.

🔴 Hard Limitations (Cannot be worked around)

1. Microphone Access — DISALLOWED

Keyboard extensions cannot access the microphone.

  • AVAudioRecorder will fail with permission error
  • SFSpeechRecognizer is unavailable
  • No Siri integration from keyboard context

Why: Apple security model — keyboards run in sandbox and could keylog audio.

2. Open Other Apps — BLOCKED

Keyboards cannot programmatically open the main app or any other app.

  • UIApplication.shared.open() returns false
  • URL schemes don't work (myapp://)
  • ExtensionContext.open() not available

Why: Prevents malicious keyboards from launching apps without user consent.

3. Memory Limit — ~50MB

Keyboard extensions have strict memory limits (~30-60MB).

  • App terminated silently if exceeded
  • No crash log, just disappears
  • Heavy audio processing = instant death

Mitigation:

  • Record at 16kHz mono (not 44.1kHz)
  • Use 32kbps bitrate max
  • Immediate file cleanup after processing
  • 60-second max recording hard limit

4. No Persistent Storage

UserDefaults unavailable, only App Groups.

  • Standard UserDefaults doesn't persist
  • Must use UserDefaults(suiteName: "group.com.company.app")
  • Requires App Group capability in both targets

5. Network Requires "Full Access"

API calls fail without user enabling "Allow Full Access" in Settings.

  • User must explicitly enable: Settings → General → Keyboard → [Keyboard Name] → Allow Full Access
  • Most users won't do this
  • Cannot prompt or explain from keyboard UI effectively

🟡 Partial Workarounds (User friction)

The "Open App" Workaround

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.

The Manual Switch Pattern

What actually works (with friction):

  1. User taps button in keyboard → Shows alert: "Open PolyVoice to record?"
  2. User manually switches to main app (Home button, swipe, etc.)
  3. Main app detects active session (via App Groups / shared state)
  4. Main app auto-records on appear
  5. Auto-stops on silence (2 seconds)
  6. Auto-copies to clipboard
  7. User manually switches back to target app
  8. Keyboard auto-pastes on reappear

User flow:

Keyboard → Tap mic → [Manual: Switch to app] → App auto-records → 
[Manual: Switch back] → Keyboard auto-pastes

Friction points:

  • Two manual app switches
  • Context switching breaks flow
  • Users forget to return
  • Clipboard may be overwritten

🟢 Alternative Architectures

Option 1: Share Extension (Better for Audio)

Use Share Sheet instead of keyboard.

  • Full app capabilities
  • Can record audio
  • Can process and return text

Limitation: Not a keyboard — user must open share sheet per text field.

Option 2: Full App Mode

Don't use keyboard extension — use main app only.

  • User opens app
  • Records dictation
  • Copies result
  • Switches to target app
  • Pastes manually

Benefit: No memory limits, full mic access, reliable.
Cost: More friction than keyboard.

Option 3: Siri Shortcuts Integration

Provide Siri Shortcuts for voice-to-text.

  • "Hey Siri, dictate with PolyVoice"
  • Returns text to current app
  • Fully supported by Apple

Limitation: Not instant, requires Siri setup.

📊 Decision Matrix

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

🎯 Recommendation

For voice dictation/AI transcription:

  1. Don't build a keyboard extension — the limitations make it frustrating
  2. Use Share Extension — Apple-supported, full capabilities
  3. Or full app — simplest to build, most reliable
  4. Add Shortcuts — for power users who want speed

For non-audio keyboards (emoji, translation, etc.):

Keyboard extension works great. Just avoid audio features.

📚 References

安全使用建议
This is an instruction-only reference about iOS keyboard extension limitations and workarounds — it requests no permissions or installs and appears coherent with its stated purpose. Before relying on it: 1) verify the details against current Apple documentation and recent WWDC sessions since platform behavior and limits can change; 2) note references to App Groups and entitlements — implementing those requires properly configured capabilities in both app and extension and user consent where appropriate; 3) the SKILL.md cites a local project path (~/Projects/polyvoice-keyboard/) and has no homepage or source provenance — treat findings as community notes rather than official guidance. If you need production-ready code or legal/privacy guidance (user notifications, Info.plist privacy strings), obtain up-to-date official docs or tested libraries.
功能分析
Type: OpenClaw Skill Name: ios-keyboard-limitations Version: 1.0.0 The skill bundle is benign. It consists solely of metadata and a documentation file (SKILL.md) detailing technical limitations and workarounds for iOS keyboard extensions. There is no executable code for the OpenClaw agent, no instructions for the agent to perform any actions (e.g., shell commands, network requests, file system access), and no evidence of prompt injection attempts, data exfiltration, or other malicious behaviors. The Swift code snippets are illustrative examples within the documentation, not commands for the agent to execute.
能力评估
Purpose & Capability
Name/description match the content: SKILL.md explains iOS keyboard sandbox, mic restrictions, memory limits, App Groups, and alternative architectures. There are no unrelated credential or binary requirements.
Instruction Scope
The SKILL.md contains developer guidance and example code snippets only; it does not instruct the agent to read files, access environment variables, call external endpoints, or perform system actions beyond documenting platform limits and workarounds.
Install Mechanism
No install spec and no code files — nothing is downloaded or written to disk. This is the lowest-risk form (instruction-only).
Credentials
No environment variables, credentials, or config paths are requested. The document explains using App Groups (an expected entitlement) but does not ask for unrelated secrets or access.
Persistence & Privilege
Skill is not always-enabled and does not request persistence or elevated platform privileges. Autonomous invocation is allowed by platform default but there is nothing in the skill that leverages that to access other skills or system secrets.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install ios-keyboard-limitations
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /ios-keyboard-limitations 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release summarizing hard technical limitations of iOS custom keyboards, focused on audio/voice features. - Details restrictions: microphone access, app launching, memory limits, storage, and networking requirements. - Documents partial workarounds and friction-heavy patterns for integrating voice features. - Compares alternative architectures: share extension, standalone app, and Siri Shortcuts. - Provides a decision matrix and clear recommendations for different use cases. - Includes reference links to Apple documentation and PolyVoice project insights.
元数据
Slug ios-keyboard-limitations
版本 1.0.0
许可证
累计安装 1
当前安装数 1
历史版本数 1
常见问题

Ios Keyboard Limitations 是什么?

iOS 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. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1008 次。

如何安装 Ios Keyboard Limitations?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install ios-keyboard-limitations」即可一键安装,无需额外配置。

Ios Keyboard Limitations 是免费的吗?

是的,Ios Keyboard Limitations 完全免费(开源免费),可自由下载、安装和使用。

Ios Keyboard Limitations 支持哪些平台?

Ios Keyboard Limitations 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ios Keyboard Limitations?

由 usimic(@usimic)开发并维护,当前版本 v1.0.0。

💬 留言讨论