第三部分:系统集成能力
14. 📋 剪贴板 — UIPasteboard
权限配置
可调用 API
| API |
框架 |
能力 |
UIPasteboard.general.string |
UIKit |
读取/写入剪贴板文本 |
UIPasteboard.general.image |
UIKit |
读取/写入剪贴板图片 |
UIPasteboard.general.url |
UIKit |
读取剪贴板 URL |
UIPasteboard.general.hasStrings |
UIKit |
检查有无文本(不触发通知) |
Agent Skills
15. 🔔 通知 — UserNotifications
权限配置
可调用 API
| API |
框架 |
能力 |
UNMutableNotificationContent |
UserNotifications |
通知内容(标题/正文/声音/附件) |
UNTimeIntervalNotificationTrigger |
UserNotifications |
延时触发 |
UNCalendarNotificationTrigger |
UserNotifications |
日历时间触发 |
UNLocationNotificationTrigger |
UserNotifications |
地点触发 |
UNNotificationAction / UNNotificationCategory |
UserNotifications |
交互按钮 |
UNNotificationAttachment |
UserNotifications |
富媒体附件 |
Agent Skills
16. 🏠 智能家居 — HomeKit
权限配置
可调用 API
| API |
框架 |
能力 |
HMHomeManager |
HomeKit |
获取所有家庭 |
HMAccessory |
HomeKit |
配件设备(灯/空调/锁等) |
HMCharacteristic.writeValue() |
HomeKit |
控制设备 |
HMCharacteristic.readValue() |
HomeKit |
读取设备状态 |
HMActionSet |
HomeKit |
场景执行 |
HMEventTrigger / HMTimerTrigger |
HomeKit |
自动化 |
Agent Skills
17. ⌨️ Shortcuts — App Intents
权限: 无需特殊权限
| API |
框架 |
能力 |
AppIntent protocol |
App Intents |
定义可被 Siri/Shortcuts 调用的操作 |
AppShortcutsProvider |
App Intents |
自动注册快捷指令 |
Agent 的每个 Skill 都可注册为 App Intent → Siri 可直接调用。
18. 🌐 网络请求 — URLSession + Network
权限: 无需特殊权限(局域网需 NSLocalNetworkUsageDescription)
| API |
框架 |
能力 |
URLSession.shared.data(from:) |
Foundation |
HTTP 请求 |
URLSession.shared.download(from:) |
Foundation |
下载文件 |
URLSession.shared.webSocketTask() |
Foundation |
WebSocket |
NWPathMonitor |
Network |
网络状态监听 |
NWBrowser |
Network |
局域网服务发现 |
NEHotspotConfiguration |
NetworkExtension |
程序化连接 WiFi |
Agent Skills
19. 🔐 Face ID — LocalAuthentication
权限: NSFaceIDUsageDescription
| API |
能力 |
LAContext.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics) |
生物识别 |
LAContext.biometryType |
Face ID / Touch ID 检测 |
Agent Skill
20. 💬 邮件/短信 — MessageUI
权限: 无需 — 系统弹出编辑界面,用户手动确认发送
| API |
能力 |
MFMailComposeViewController |
编辑发送邮件(支持附件) |
MFMessageComposeViewController |
编辑发送短信/iMessage |
Agent Skills