All Products
Document Center

Obtain base library version

Last Updated: Feb 04, 2021


Note: This interface is only supported in mPaaS 10.1.32 and later versions.

You can call this interface to get the version number of the base library. The base library version is for reference only, it is not suggested to make your code logic rely on this value.

Sample code

  1. <!-- API-DEMO page/API/sdk-version/sdk-version.axml-->
  2. <view class="page">
  3. <view class="page-description">API for getting base library version number</view>
  4. <view class="page-section">
  5. <view class="page-section-title">my.SDKVersion</view>
  6. <view class="page-section-demo">
  7. <button type="primary" onTap="getSDKVersion">Get base library version number</button>
  8. </view>
  9. </view>
  10. </view>
  1. // API-DEMO page/API/sdk-version/sdk-version.js
  2. Page({
  3. getSDKVersion() {
  4. my.alert({
  5. content: my.SDKVersion,
  6. });
  7. },
  8. });

Return value

The return value is a string which is the version number of the base library.