my.getRunScene
Use this API to obtain the running version of the current Mini Program.
Supported types of mini programs: DSL, H5+
Sample Code
DSL
copy
my.getRunScene({
success(result) {
my.alert({
title: 'Mini Program version',
content:`${result.envVersion}`
});
},
})H5+
copy
AlipayJSBridge.call('getRunScene', {}, function (data) {
alert('Result' + ':\n' + JSON.stringify(data));
});Parameters
| Property | Type | Required | Description |
| success | Function | No | The callback function for a successful API call. |
| fail | Function | No | The callback function for a failed API call. |
| complete | Function | No | The callback function used when the API call is completed. This function is always executed no matter the call succeeds or fails. |
Success Callback Function
| Property | Type | Description |
| envVersion | String | The current running version of the Mini Program. Valid values are: - develop: development version- release: release version |
Fail Callback Function
| Property | Type | Description |
| error | String | The error code. |
| errorMessage | String | The error message. |
Error Code
| Error Code | Description |
| 3 | An unknown error has occurred. |