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

PropertyType

Required

Description
successFunctionNoThe callback function for a successful API call. 
failFunctionNoThe callback function for a failed API call.
completeFunctionNoThe callback function used when the API call is completed. This function is always executed no matter the call succeeds or fails.

Success Callback Function

PropertyTypeDescription
envVersionStringThe current running version of the Mini Program. Valid values are:
- develop: development version
- release: release version 

Fail Callback Function

PropertyTypeDescription
errorStringThe error code.
errorMessageStringThe error message.

Error Code

Error CodeDescription
3An unknown error has occurred.