my.getRunScene
Use this API to obtain the running version of the current Mini Program.
Sample Code
copy
my.getRunScene({
success(result) {
my.alert({
title: 'Mini Program version',
content:`${result.envVersion}`
});
},
})
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. |