Show WebView
Pop up a WebView in the current app to open the specified URL, this interface will not trigger authorization prompts.
Interface Description
Interface Type
execShortcutParameters
| Parameter | Type | Required | Description |
|---|---|---|---|
deviceId | string | ✅ | Device ID |
directive | string | ✅ | Fixed value 'showWebview' |
payload | string | ✅ | URL address to open |
Return Value
javascript
true // Returns true on successful openingBasic Usage
javascript
// Open webpage in WebView
await apiInvoke('execShortcut', {
deviceId: 'P72578581E07',
directive: 'showWebview',
payload: 'https://www.baidu.com'
});Difference from openUrl
| Feature | openUrl | showWebview |
|---|---|---|
| Opening Method | Open in Safari | Pop up WebView in app |
| App Switching | Switches to Safari | Stays in current app |