Skip to content

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

execShortcut

Parameters

ParameterTypeRequiredDescription
deviceIdstringDevice ID
directivestringFixed value 'showWebview'
payloadstringURL address to open

Return Value

javascript
true  // Returns true on successful opening

Basic Usage

javascript
// Open webpage in WebView
await apiInvoke('execShortcut', {
    deviceId: 'P72578581E07',
    directive: 'showWebview',
    payload: 'https://www.baidu.com'
});

Difference from openUrl

FeatureopenUrlshowWebview
Opening MethodOpen in SafariPop up WebView in app
App SwitchingSwitches to SafariStays in current app

Cooperation: try.catch@foxmail.com