Retrieve Storage Data
methodName: getStorage
Additional Parameters:
Property | Type | Required | Default | Description |
---|---|---|---|---|
key | String | Yes | The key for the stored data. |
Success Callback Function
Parameters
Object res
Property | Type | Description |
---|---|---|
data | String | The data stored under the specified key. |
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('getStorage', {
key: 'myDataKey',
success: (res) => {
console.log('Success: ', res);
},
fail: (res) => {
console.log('Fail: ', res);
},
complete: (res) => {
console.log('Complete: ', res);
},
});
}