Basic
Core APIs for version checking, feature detection, and app identification.| API | Description | DSL | H5+ |
|---|---|---|---|
| my.canIUse | Check if an API or feature is supported | ✅ | ❌ |
| my.SDKVersion | Get the SDK version | ✅ | ❌ |
| my.getAppIdSync | Get the Mini Program App ID synchronously | ✅ | ❌ |
| my.getRunScene | Get the current running environment | ✅ | ✅ |
In-App Event
APIs for handling app lifecycle events and errors.| API | Description | DSL | H5+ |
|---|---|---|---|
| my.onAppShow | Listen for app show events | ✅ | ❌ |
| my.offAppShow | Stop listening for app show events | ✅ | ❌ |
| my.onAppHide | Listen for app hide events | ✅ | ❌ |
| my.offAppHide | Stop listening for app hide events | ✅ | ❌ |
| my.onError | Listen for error events | ✅ | ❌ |
| my.offError | Stop listening for error events | ✅ | ❌ |
| my.onUnhandledRejection | Listen for unhandled promise rejections | ✅ | ❌ |
| my.offUnhandledRejection | Stop listening for unhandled rejections | ✅ | ❌ |
UI
Navigation Bar
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.setNavigationBar | Set navigation bar properties | ✅ | ✅ |
| my.showNavigationBarLoading | Show navigation bar loading indicator | ✅ | ✅ |
| my.hideNavigationBarLoading | Hide navigation bar loading indicator | ✅ | ✅ |
| my.hideBackHome | Hide the back to home button | ✅ | ❌ |
Tab Bar
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.hideTabBar | Hide the tab bar | ✅ | ❌ |
| my.setTabBarStyle | Set tab bar style | ✅ | ❌ |
Route
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.navigateTo | Navigate to a new page | ✅ | ❌ |
| my.navigateBack | Navigate back to previous page | ✅ | ❌ |
| my.redirectTo | Redirect to a page (closes current) | ✅ | ❌ |
| my.reLaunch | Relaunch to a page (closes all others) | ✅ | ❌ |
| my.switchTab | Switch to a tab page | ✅ | ❌ |
Feedback
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.alert | Show alert dialog | ✅ | ✅ |
| my.confirm | Show confirmation dialog | ✅ | ✅ |
| my.prompt | Show prompt dialog with input | ✅ | ✅ |
| my.showToast | Show toast message | ✅ | ✅ |
| my.hideToast | Hide toast message | ✅ | ✅ |
| my.showLoading | Show loading indicator | ✅ | ✅ |
| my.hideLoading | Hide loading indicator | ✅ | ✅ |
| my.showActionSheet | Show action sheet | ✅ | ✅ |
Pull-down Refresh
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.startPullDownRefresh | Start pull-down refresh | ✅ | ❌ |
| my.stopPullDownRefresh | Stop pull-down refresh | ✅ | ❌ |
Other UI APIs
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.choosePhoneContact | Choose a phone contact | ✅ | ✅ |
| my.datePicker | Show date picker | ✅ | ✅ |
| my.createAnimation | Create animation instance | ✅ | ❌ |
| my.createCanvasContext | Create canvas context | ✅ | ❌ |
| my.hideKeyboard | Hide the keyboard | ✅ | ✅ |
| my.pageScrollTo | Scroll page to position | ✅ | ❌ |
| my.createSelectorQuery | Create selector query | ✅ | ❌ |
| my.multiLevelSelect | Show multi-level selector | ✅ | ✅ |
| my.setBackgroundColor | Set page background color | ✅ | ✅ |
| my.setCanPullDown | Enable/disable pull-down | ✅ | ✅ |
Media
Image
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.chooseImage | Choose images from album or camera | ✅ | ✅ |
| my.previewImage | Preview images in fullscreen | ✅ | ✅ |
| my.saveImage | Save image to album | ✅ | ✅ |
| my.getImageInfo | Get image information | ✅ | ✅ |
| my.compressImage | Compress an image | ✅ | ✅ |
Video
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.chooseVideo | Choose video from album or camera | ✅ | ✅ |
Lottie
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.createLottieContext | Create Lottie animation context | ✅ | ❌ |
Storage
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.setStorage | Store data asynchronously | ✅ | ✅ |
| my.setStorageSync | Store data synchronously | ✅ | ❌ |
| my.getStorage | Get stored data asynchronously | ✅ | ✅ |
| my.getStorageSync | Get stored data synchronously | ✅ | ❌ |
| my.removeStorage | Remove stored data asynchronously | ✅ | ✅ |
| my.removeStorageSync | Remove stored data synchronously | ✅ | ❌ |
| my.clearStorage | Clear all stored data asynchronously | ✅ | ✅ |
| my.clearStorageSync | Clear all stored data synchronously | ✅ | ❌ |
File
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.saveFile | Save file to local storage | ✅ | ✅ |
| my.getFileInfo | Get file information | ✅ | ✅ |
| my.getSavedFileInfo | Get saved file information | ✅ | ✅ |
| my.getSavedFileList | Get list of saved files | ✅ | ✅ |
| my.removeSavedFile | Remove a saved file | ✅ | ✅ |
| my.chooseFileFromDisk | Choose file from disk | ✅ | ✅ |
| my.openDocument | Open a document | ✅ | ✅ |
Location
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getLocation | Get current location | ✅ | ✅ |
| my.openLocation | Open location in map | ✅ | ✅ |
| my.chooseLocation | Choose a location on map | ✅ | ✅ |
Map
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.createMapContext | Create map context | ✅ | ❌ |
| my.calculateRoute | Calculate route between points | ✅ | ✅ |
Network
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.request | Make HTTP request | ✅ | ✅ |
| my.uploadFile | Upload file | ✅ | ✅ |
| my.downloadFile | Download file | ✅ | ✅ |
| my.connectSocket | Create WebSocket connection | ✅ | ❌ |
| my.sendSocketMessage | Send WebSocket message | ✅ | ❌ |
| my.closeSocket | Close WebSocket connection | ✅ | ❌ |
| my.onSocketOpen | Listen for WebSocket open | ✅ | ❌ |
| my.offSocketOpen | Stop listening for WebSocket open | ✅ | ❌ |
| my.onSocketMessage | Listen for WebSocket messages | ✅ | ❌ |
| my.offSocketMessage | Stop listening for WebSocket messages | ✅ | ❌ |
| my.onSocketError | Listen for WebSocket errors | ✅ | ❌ |
| my.offSocketError | Stop listening for WebSocket errors | ✅ | ❌ |
| my.onSocketClose | Listen for WebSocket close | ✅ | ❌ |
| my.offSocketClose | Stop listening for WebSocket close | ✅ | ❌ |
Device
System & Network
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getSystemInfo | Get system information | ✅ | ✅ |
| my.getNetworkType | Get network type | ✅ | ✅ |
Clipboard
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getClipboard | Get clipboard content | ✅ | ✅ |
| my.setClipboard | Set clipboard content | ✅ | ✅ |
Sensors
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.onAccelerometerChange | Listen for accelerometer changes | ✅ | ✅ |
| my.offAccelerometerChange | Stop listening for accelerometer | ✅ | ✅ |
| my.onCompassChange | Listen for compass changes | ✅ | ✅ |
| my.offCompassChange | Stop listening for compass | ✅ | ✅ |
| my.watchShake | Watch for device shake | ✅ | ✅ |
Phone & Screen
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.makePhoneCall | Make a phone call | ✅ | ✅ |
| my.vibrate | Vibrate the device | ✅ | ✅ |
| my.vibrateShort | Trigger a short vibration | ✅ | ✅ |
| my.vibrateLong | Trigger a long vibration | ✅ | ✅ |
| my.setKeepScreenOn | Keep screen on | ✅ | ✅ |
| my.getScreenBrightness | Get screen brightness | ✅ | ✅ |
| my.setScreenBrightness | Set screen brightness | ✅ | ✅ |
| my.getScreenOrientation | Get screen orientation | ✅ | ✅ |
| my.setScreenOrientation | Set screen orientation | ✅ | ✅ |
| my.onUserCaptureScreen | Listen for screenshots | ✅ | ❌ |
| my.offUserCaptureScreen | Stop listening for screenshots | ✅ | ❌ |
Settings & Permissions
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getSetting | Get user settings | ✅ | ✅ |
| my.openSetting | Open settings page | ✅ | ✅ |
| my.showAuthGuide | Show permission guide | ✅ | ✅ |
Other Device APIs
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.addPhoneContact | Add phone contact | ✅ | ✅ |
| my.scan | Scan QR/barcode | ✅ | ✅ |
| my.onMemoryWarning | Listen for memory warnings | ❌ | ❌ |
| my.offMemoryWarning | Stop listening for memory warnings | ❌ | ❌ |
| my.getBatteryInfo | Get battery info asynchronously | ✅ | ✅ |
| my.getBatteryInfoSync | Get battery info synchronously | ✅ | ❌ |
Bluetooth
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.openBluetoothAdapter | Initialize Bluetooth adapter | ✅ | ❌ |
| my.closeBluetoothAdapter | Close Bluetooth adapter | ✅ | ❌ |
| my.getBluetoothAdapterState | Get Bluetooth adapter state | ✅ | ❌ |
| my.startBluetoothDevicesDiscovery | Start discovering devices | ✅ | ❌ |
| my.stopBluetoothDevicesDiscovery | Stop discovering devices | ✅ | ❌ |
| my.getBluetoothDevices | Get discovered devices | ✅ | ❌ |
| my.getConnectedBluetoothDevices | Get connected devices | ✅ | ❌ |
| my.connectBLEDevice | Connect to BLE device | ✅ | ❌ |
| my.disconnectBLEDevice | Disconnect BLE device | ✅ | ❌ |
| my.getBLEDeviceServices | Get BLE device services | ✅ | ❌ |
| my.getBLEDeviceCharacteristics | Get BLE characteristics | ✅ | ❌ |
| my.readBLECharacteristicValue | Read BLE characteristic | ✅ | ❌ |
| my.writeBLECharacteristicValue | Write BLE characteristic | ✅ | ❌ |
| my.notifyBLECharacteristicValueChange | Enable BLE notifications | ✅ | ❌ |
Biometric Authentication
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.checkLocalBioAuthSupported | Check biometric support | ✅ | ✅ |
| my.startLocalBioAuth | Start biometric authentication | ✅ | ✅ |
Sharing
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.showSharePanel | Show share panel | ✅ | ✅ |
Update
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getUpdateManager | Get update manager instance | ✅ | ❌ |
web-view
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.createWebViewContext | Create WebView context | ✅ | ❌ |
Alipay Connect
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getSiteInfo | Get site information | ✅ | ❌ |
Open Capabilities
| API | Description | DSL | H5+ |
|---|---|---|---|
| my.getAuthCode | Get authorization code | ✅ | ✅ |
| my.getOpenUserInfo | Get user information | ✅ | ❌ |
| my.tradePay | Trigger payment | ✅ | ✅ |
| my.signContract | Sign contract | ✅ | ❌ |
| my.navigateToMiniProgram | Navigate to another Mini Program | ✅ | ✅ |
| my.navigateBackMiniProgram | Navigate back to previous Mini Program | ✅ | ✅ |