Skip to content

Open URL

Open a specified URL in the iOS device's Safari browser.

Interface Description

Interface Type

execShortcut

Parameters

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

Return Value

javascript
true  // Returns true on successful opening

Basic Usage

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

Notes

Tips

  • Opening an unauthorized URL will trigger a permission request, which developers need to handle themselves

Cooperation: try.catch@foxmail.com