Set Clipboard Data
methodName: setClipboard
Note: This interface's functionality may involve privacy issues, so please use it with caution.
Additional Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
text | String | Yes | Clipboard data |
Success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure |
Fail Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
success | String | Describes whether the interface call was successful or not. "true" for success, "false" for failure |
errMsg | String | Error message |
Example Usage
const dlt = window['@transsion/byteh5bridge'];
const canCallDlt = dlt && window.dltms && window.dltms.isMiniShellGame();
if (canCallDlt) {
dlt.callApi('setClipboard', {
text: 'The text to be copied',
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}