Send Text
Due to iOS privacy restrictions, you need to work with Shortcuts to send arbitrary text to the device.
Recommended plan
- Install and bind the official Shortcut on the target device. See Shortcut APIs.
- Call
execShortcutto write the desired text into the device clipboard. - Trigger
sendKeywithCOMMAND + Vto insert the clipboard content into the focused input field.
Example
javascript
// 1. Write text into the clipboard via Shortcut
await apiInvoke('execShortcut', {
deviceId: 'P72578581E07',
name: 'writeClipboard',
args: {
text: 'Hello iClick! 😄'
}
});
// 2. Paste the text with COMMAND + V
await apiInvoke('sendKey', {
deviceId: 'P72578581E07',
key: 'V',
fnkey: 'COMMAND'
});