Basic
| API Name | Description |
|---|---|
| wx.env | Environment variables |
| wx.canIUse | Determines whether the APIs, callbacks, parameters, and components of Mini Progr |
| wx.base64ToArrayBuffer | Converts a Base64 string to an ArrayBuffer object. |
| wx.arrayBufferToBase64 | Converts an ArrayBuffer object to a Base64 string. |
System
| API Name | Description |
|---|---|
| wx.openSystemBluetoothSetting | Navigate to the system Bluetooth settings page |
| wx.openAppAuthorizeSetting | Navigate to the system WeChat authorization management page |
| wx.getWindowInfo | Get window information |
| wx.getSystemSetting | Get device settings |
| wx.getSystemInfoSync | Synchronous version of wx.getSystemInfo |
| wx.getSystemInfoAsync | Get system information asynchronously |
| wx.getSystemInfo | Get system information |
| wx.getSkylineInfoSync | Get the support status of the Skyline rendering engine in the current runtime en |
| wx.getSkylineInfo | Get the support status of the Skyline rendering engine in the current runtime en |
| wx.getRendererUserAgent | Get the UserAgent of the Webview Mini Program |
| wx.getDeviceInfo | Get device basic information |
| wx.getDeviceBenchmarkInfo | Get device performance score and model tier data |
| wx.getAppBaseInfo | Get WeChat app basic information |
| wx.getAppAuthorizeSetting | Get WeChat app authorization settings |
Update
| API Name | Description |
|---|---|
| wx.updateWeChatApp | Updates the client version. |
| wx.getUpdateManager | Gets the globally unique version update manager, which is used to manage Mini Pr |
| wx.getPluginUpdateManager | Gets the plugin version update manager, which is used to manage updates for a sp |
PluginUpdateManager
| API Name | Description |
|---|---|
| PluginUpdateManager.onCheckForUpdate | Listens for the event where the Mini Program requests to check the plugin update |
| PluginUpdateManager.onUpdateFailed | Listens for the plugin update failure event. |
| PluginUpdateManager.onUpdateReady | Listens for the event where a new version of the plugin is available. |
UpdateManager
| API Name | Description |
|---|---|
| UpdateManager.applyUpdate | Forces Mini Program to restart and use the new version. |
| UpdateManager.onCheckForUpdate | Listens for the event where the Mini Program requests to check the update result |
| UpdateManager.onUpdateFailed | Listens for the Mini Program update failure event. |
| UpdateManager.onUpdateReady | Listens for the event where a new version of Mini Program is available. |
Mini Program
Lifecycle
| API Name | Description |
|---|---|
| wx.onApiCategoryChange | Listen to API category change events |
| wx.offApiCategoryChange | Remove the listener function for API category change events |
| wx.getLaunchOptionsSync | Get the parameters from the Mini Program startup |
| wx.getEnterOptionsSync | Get the parameters from the most recent foreground entry of Mini Program |
| wx.getApiCategory | Get the current API category |
Application-level events
| API Name | Description |
|---|---|
| wx.postMessageToReferrerPage | Send a message to the originating page |
| wx.postMessageToReferrerMiniProgram | Send a message to the originating Mini Program from which the navigation was ini |
| wx.onUnhandledRejection | Listen to the unhandled Promise rejection event |
| wx.onThemeChange | Listen to the system theme change event |
| wx.onPageNotFound | Listen to the event where the page to be opened in Mini Program does not exist |
| wx.onLazyLoadError | Listen to the Mini Program async component loading failure event |
| wx.onError | Listen to the Mini Program error event |
| wx.onAudioInterruptionEnd | Listen to the end of the audio interruption event |
| wx.onAudioInterruptionBegin | Listen to the event where audio playback starts being interrupted due to system |
| wx.onAppShow | Listen to the Mini Program resume-to-foreground event |
| wx.onAppHide | Listen to Mini Program switching to background event |
| wx.offUnhandledRejection | Remove the listener function for unhandled Promise rejection event |
| wx.offThemeChange | Remove the listener function for system theme change event |
| wx.offPageNotFound | Remove the listener function for Mini Program page not found event |
| wx.offLazyLoadError | Remove the listener function for Mini Program async component loading failure ev |
| wx.offError | Remove the listener function for Mini Program error event |
| wx.offAudioInterruptionEnd | Remove the listener function for audio interruption end event |
| wx.offAudioInterruptionBegin | Remove the listener function for audio interruption start event caused by system |
| wx.offAppShow | Remove the listener function for Mini Program switching to foreground event |
| wx.offAppHide | Remove the listener function for Mini Program switching to background event |
Routing events
| API Name | Description |
|---|---|
| wx.onBeforePageUnload | Listen to the event before an existing page instance is destroyed due to a routi |
| wx.onBeforePageLoad | Listen to the event before a new page instance is instantiated due to a routing |
| wx.onBeforeAppRoute | Listen to the event after the routing event is dispatched but before the routing |
| wx.onAppRouteDone | Listen to the event when the current routing animation execution is completed. S |
| wx.onAppRoute | Listen to the event after the routing event is dispatched and the routing logic |
| wx.onAfterPageUnload | Listen to the event when an existing page instance is destroyed due to a routing |
| wx.onAfterPageLoad | Listen to the event when a new page instance is created due to a routing event a |
| wx.offBeforePageUnload | Remove the listener function for routing events |
| wx.offBeforePageLoad | Remove the listener function for routing events |
| wx.offBeforeAppRoute | Remove the listener function for routing events |
| wx.offAppRouteDone | Remove the listener function for the event of the current routing animation comp |
| wx.offAppRoute | Remove the listener function for routing events |
| wx.offAfterPageUnload | Remove the listener function for routing events |
| wx.offAfterPageLoad | Remove the listener function for routing events |
Debugging
| API Name | Description |
|---|---|
| wx.setEnableDebug | Set whether to enable the debug switch |
| wx.getRealtimeLogManager | Get the real-time log manager object |
| wx.getLogManager | Get the log manager object |
console
| API Name | Description |
|---|---|
| console.debug | Print debug logs to the debugging panel |
| console.error | Print error logs to the debugging panel |
| console.group | Create a new group in the debugging panel |
| console.groupEnd | End the group created by console.group |
| console.info | Print info logs to the debugging panel |
| console.log | Print log logs to the debugging panel |
| console.warn | Print warn logs to the debugging panel |
LogManager
| API Name | Description |
|---|---|
| LogManager.debug | Write a debug log |
| LogManager.info | Write an info log |
| LogManager.log | Write a log |
| LogManager.warn | Write a warn log |
RealtimeLogManager
| API Name | Description |
|---|---|
| RealtimeLogManager.addFilterMsg | Add a filter keyword. Not supported in plugins yet |
| RealtimeLogManager.error | Write an error log. Not supported in plugins yet |
| RealtimeLogManager.getCurrentState | Real-time logs aggregate and report logs cached within a specific time interval. |
| RealtimeLogManager.in | Set the page containing the real-time log page parameter. Not supported in plugi |
| RealtimeLogManager.info | Write an info log. Not supported in plugins yet |
| RealtimeLogManager.setFilterMsg | Set the filter keyword. Not supported in plugins yet |
| RealtimeLogManager.tag | Get the log manager instance for the specified tag. Currently, only supported in |
| RealtimeLogManager.warn | Write a warn log. Not supported in plugins yet |
RealtimeTagLogManager
| API Name | Description |
|---|---|
| RealtimeTagLogManager.addFilterMsg | Add a filter keyword |
| RealtimeTagLogManager.error | Write an error log |
| RealtimeTagLogManager.info | Write info log |
| RealtimeTagLogManager.setFilterMsg | Set filter keywords |
| RealtimeTagLogManager.warn | Write warn log |
Performance
| API Name | Description |
|---|---|
| wx.requestIdleCallback | Register a function to be called during idle periods |
| wx.reportPerformance | Mini Program speed measurement reporting |
| wx.preloadWebview | Preload the WebView for the next page |
| wx.preloadSkylineView | Preload the Skyline runtime environment required by the next page |
| wx.preloadAssets | Preload media resource files for the view layer; currently supported: font, imag |
| wx.getPerformance | Get current Mini Program performance-related information |
| wx.cancelIdleCallback | Unregister the specified callback function previously registered |
| PerformanceEntry | Single performance data entry |
EntryList
| API Name | Description |
|---|---|
| EntryList.getEntries | This method returns all performance data in the current list |
| EntryList.getEntriesByName | Get all performance data in the current list with the name [name] and type [entr |
| EntryList.getEntriesByType | Get all performance data in the current list with the type [entryType] |
Performance
| API Name | Description |
|---|---|
| Performance.createObserver | Create a global performance event listener |
| Performance.getEntries | This method returns all performance data in the current buffer |
| Performance.getEntriesByName | Get all performance data in the current buffer with the name [name] and type [en |
| Performance.getEntriesByType | Get all performance data in the current buffer with the type [entryType] |
| Performance.setBufferSize | Set the buffer size; by default, 30 performance data entries are buffered |
PerformanceObserver
| API Name | Description |
|---|---|
| PerformanceObserver.disconnect | Stop listening |
| PerformanceObserver.observe | Start listening |
Subpackage loading
| API Name | Description |
|---|---|
| wx.preDownloadSubpackage | Trigger subpackage pre-download |
PreDownloadSubpackageTask
| API Name | Description |
|---|---|
| PreDownloadSubpackageTask.onProgressUpdate | Listen for subpackage loading progress change events |
Encryption
| API Name | Description |
|---|---|
| wx.getUserCryptoManager | Get the user encryption module |
UserCryptoManager
| API Name | Description |
|---|---|
| UserCryptoManager.getLatestUserKey | Get the latest user encryption key |
| UserCryptoManager.getRandomValues | Get cryptographically secure random numbers |
Routing
| API Name | Description |
|---|---|
| wx.switchTab | Navigate to a tabBar page and close all other non-tabBar pages. |
| wx.rewriteRoute | Rewrite the ongoing routing event. For details, see Routing Rewrite. |
| wx.reLaunch | Close all pages and open a specified page within the Mini Program. |
| wx.redirectTo | Close the current page and navigate to a specified page within the Mini Program. |
| wx.navigateTo | Keep the current page and navigate to a specified page within the Mini Program. |
| wx.navigateBack | Close the current page and return to the previous page or multiple levels up. |
EventChannel
| API Name | Description |
|---|---|
| EventChannel.emit | Trigger an event. |
| EventChannel.off | Remove the listener for an event. |
| EventChannel.on | Continuously listen to an event. |
| EventChannel.once | Listen to an event once; the listener becomes invalid after it is triggered. |
Custom Routing
| API Name | Description |
|---|---|
| wx.router | The router object, which can be obtained via . |
Basic
| API Name | Description |
|---|---|
| router.addRouteBuilder | Add custom routing configuration. |
| router.getRouteContext | Get the custom routing context object corresponding to the page. |
| router.removeRouteBuilder | Remove custom routing configuration. |
Navigate
| API Name | Description |
|---|---|
| wx.restartMiniProgram | Restart the current Mini Program |
| wx.requestAutomaticRepayment | Use Mini Program in the WeChat client to launch a page requesting user confirmat |
| wx.openPhotoTopicView | Open the WeChat official sticker topic publishing page |
| wx.openOfficialAccountProfile | Open the Official Account homepage via Mini Program |
| wx.openOfficialAccountChat | Open the Official Account chat interface via Mini Program |
| wx.openOfficialAccountArticle | Open any Official Account article via Mini Program (excluding articles with temp |
| wx.openInquiriesTopic | Open a "Ask a Question" topic via Mini Program |
| wx.openEmbeddedMiniProgram | Open the half-screen Mini Program |
| wx.onEmbeddedMiniProgramHeightChange | Listen for the event of changes in the visible height of the half-screen Mini Pr |
| wx.offEmbeddedMiniProgramHeightChange | Remove the listener function for the event of changes in the visible height of t |
| wx.navigateToMiniProgram | Open another Mini Program |
| wx.navigateBackMiniProgram | Return to the previous Mini Program |
| wx.exitMiniProgram | Exit the current Mini Program |
| wx.copyRealname | Real-name information query and copy |
Chat tools
| API Name | Description |
|---|---|
| wx.shareVideoToGroup | Forwards a video to the chat |
| wx.shareImageToGroup | Forwards an image to the chat |
| wx.shareFileToGroup | Forwards a file to the chat |
| wx.shareEmojiToGroup | Forwards an emoji to the chat |
| wx.shareAppMessageToGroup | Forwards a Mini Program card to the chat |
| wx.selectGroupMembers | Selects members from a chat room and returns the group_openid of the selected me |
| wx.openChatTool | Enters chat tool mode |
| wx.notifyGroupMembers | Reminds the user to complete a task. The title length must not exceed 30 charact |
| wx.getChatToolInfo | Retrieves group chat information in chat tool mode |
| wx.enterChatToolMode | Enters the open capability mode for chat tools |
Forwarding
| API Name | Description |
|---|---|
| wx.updateShareMenu | Update forwarding attributes. |
| wx.showShareMenu | Set whether the share button in the details page opened from the top-right corne |
| wx.showShareImageMenu | Open the share image dialog, allowing users to send the image to a friend, share |
| wx.shareVideoMessage | Forward a video to a chat. |
| wx.shareToOfficialAccount | Supports invoking the Sticker Publishing page, allowing users to publish images |
| wx.shareFileMessage | Forward a file to a chat. |
| wx.onCopyUrl | Listen to the event triggered when the user taps the "Copy Link" button in the t |
| wx.offCopyUrl | Remove all listener functions for the event triggered when the user taps the "Co |
| wx.hideShareMenu | Hide the forward button on the current page. |
| wx.getShareInfo | Get detailed forwarding information (primarily to obtain the Group ID). |
| wx.authPrivateMessage | Verify private messages. |
UI
Interaction
| API Name | Description |
|---|---|
| wx.showToast | Show the toast message |
| wx.showModal | Show the modal dialog |
| wx.showLoading | Show the loading indicator |
| wx.showActionSheet | Show the action menu |
| wx.hideToast | Hide the toast message |
| wx.hideLoading | Hide the loading indicator |
| wx.enableAlertBeforeUnload | Enable the Mini Program page back confirmation dialog |
| wx.disableAlertBeforeUnload | Close the Mini Program page back confirmation dialog |
Navigation Bar
| API Name | Description |
|---|---|
| wx.showNavigationBarLoading | Show the navigation bar loading animation on the current page |
| wx.setNavigationBarTitle | Dynamically set the title of the current page |
| wx.setNavigationBarColor | Set the navigation bar color of the page |
| wx.hideNavigationBarLoading | Hide the navigation bar loading animation on the current page |
| wx.hideHomeButton | Hide the back-to-home button |
Background
| API Name | Description |
|---|---|
| wx.setBackgroundTextStyle | Dynamically set the style of the pull-down background font and loading image |
| wx.setBackgroundColor | Dynamically set the window background color |
Tab Bar
| API Name | Description |
|---|---|
| wx.showTabBarRedDot | Shows the red badge in the upper-right corner of a specified tabBar item. |
| wx.showTabBar | Shows the tabBar. |
| wx.setTabBarStyle | Dynamically sets the overall style of the tabBar. |
| wx.setTabBarItem | Dynamically sets the content of a specified tabBar item. Since , images support |
| wx.setTabBarBadge | Adds text to the upper-right corner of a specified tabBar item. |
| wx.removeTabBarBadge | Removes the text from the upper-right corner of a specified tabBar item. |
| wx.hideTabBarRedDot | Hides the red badge in the upper-right corner of a specified tabBar item. |
| wx.hideTabBar | Hides the tabBar. |
Font
| API Name | Description |
|---|---|
| wx.loadFontFace | Dynamically load web fonts |
| wx.loadBuiltInFontFace | Load built-in fonts |
Pull-down Refresh
| API Name | Description |
|---|---|
| wx.stopPullDownRefresh | Stop pull-down refresh on the current page |
| wx.startPullDownRefresh | Start pull-down refresh |
Scrolling
| API Name | Description |
|---|---|
| wx.pageScrollTo | Scrolls the page to the target position, supporting both selector and scroll dis |
ScrollViewContext
| API Name | Description |
|---|---|
| ScrollViewContext.closeRefresh | Disable pull-down refresh |
| ScrollViewContext.closeTwoLevel | Disable secondary pull-down |
| ScrollViewContext.scrollIntoView | Scroll to a specified position |
| ScrollViewContext.scrollTo | Scroll to a specified position |
| ScrollViewContext.triggerRefresh | Trigger pull-down refresh |
| ScrollViewContext.triggerTwoLevel | Trigger secondary pull-down |
Animation
| API Name | Description |
|---|---|
| wx.createAnimation | Create an animation instance animation |
Animation
| API Name | Description |
|---|---|
| Animation.backgroundColor | Set background color |
| Animation.bottom | Set bottom value |
| Animation.export | Export animation queue |
| Animation.height | Set height |
| Animation.left | Set left value |
| Animation.matrix | Same as transform-function matrix |
| Animation.matrix3d | Same as transform-function matrix3d |
| Animation.opacity | Set opacity |
| Animation.right | Set right value |
| Animation.rotate | Rotate clockwise by an angle from the origin |
| Animation.rotate3d | Rotate clockwise by an angle from the fixed axis |
| Animation.rotateX | Rotate clockwise by an angle from the X-axis |
| Animation.rotateY | Rotate clockwise by an angle from the Y-axis |
| Animation.rotateZ | Rotate clockwise by an angle from the Z-axis |
| Animation.scale | Scale |
| Animation.scale3d | Scale |
| Animation.scaleX | Scale X-axis |
| Animation.scaleY | Scale Y-axis |
| Animation.scaleZ | Scale Z-axis |
| Animation.skew | Skew X and Y-axis coordinates |
| Animation.skewX | Skew X-axis coordinates |
| Animation.skewY | Skew Y-axis coordinates |
| Animation.step | Indicates that a group of animations has completed |
| Animation.top | Set the top value |
| Animation.translate | Translation transform |
| Animation.translate3d | Apply translation transform to x, y, and z coordinates |
| Animation.translateX | Translate along the X-axis |
| Animation.translateY | Translate along the Y-axis |
| Animation.translateZ | Translate along the Z-axis |
| Animation.width | Set width |
Stick to top
| API Name | Description |
|---|---|
| wx.setTopBarText | Dynamically sets the text content of the stick-to-top bar. |
Custom Component
| API Name | Description |
|---|---|
| wx.nextTick | Defer a part of the operation to the next time slice for execution |
Menu
| API Name | Description |
|---|---|
| wx.onUserTriggerTranslation | Listen for the event where the user triggers the translation feature in the Mini |
| wx.onUserOffTranslation | Listen for the event where the user actively cancels translation |
| wx.onMenuButtonBoundingClientRectWeightChange | Listen for layout position changes of the menu button (capsule button in the top |
| wx.offUserTriggerTranslation | Remove the listener function for the user triggering the translation feature in |
| wx.offUserOffTranslation | Remove the listener function for the user actively canceling translation event |
| wx.offMenuButtonBoundingClientRectWeightChange | Remove the listener function for layout position changes of the menu button (cap |
| wx.getMenuButtonBoundingClientRect | Get the layout position information of the menu button (capsule button in the to |
Window
| API Name | Description |
|---|---|
| wx.setWindowSize | Sets the window size. This API is only applicable to the PC platform. For usage |
| wx.onWindowStateChange | Listens to the Mini Program window state change event. |
| wx.onWindowResize | Listens to the window size change event. |
| wx.onParallelStateChange | Listens to the Mini Program split-view state change event. |
| wx.offWindowStateChange | Removes the listener function for the Mini Program window state change event. |
| wx.offWindowResize | Removes the listener function for the window size change event. |
| wx.offParallelStateChange | Removes the listener function for the Mini Program split-view state change event |
| wx.checkIsPictureInPictureActive | Returns whether picture-in-picture playback is currently active (available under |
Worklet Animation
| API Name | Description |
|---|---|
| wx.worklet | Worklet object, which can be obtained via . |
Basic
| API Name | Description |
|---|---|
| worklet.cancelAnimation | Cancels the animation driven by . |
| worklet.derived | Derivative value , which can generate other shared variables based on an existin |
| worklet.getBoundingClientRect | Synchronously retrieves the node layout boundingClientRect. |
| worklet.scrollViewContext | instance, which can operate components within the function. |
| worklet.scrollViewContext.scrollTo | Scrolls to the specified position. |
| worklet.shared | Creates a shared variable , used for sharing data across threads and driving ani |
Animation
| API Name | Description |
|---|---|
| worklet.decay | Scroll-decay-based animation |
| worklet.Easing | The Easing module implements common animation easing functions (for animation ef |
| worklet.spring | Physics-based animation |
| worklet.timing | Time-based animation |
Composite animation
| API Name | Description |
|---|---|
| worklet.delay | Delayed animation |
| worklet.repeat | Repeated animation |
| worklet.sequence | Combines animation sequences to execute the passed animations in order. |
Utility Functions
| API Name | Description |
|---|---|
| worklet.runOnJS | When the function runs on the thread, the captured external function may be of |
| worklet.runOnUI | Executes the worklet function on the UI thread. |
Network
Send request
| API Name | Description |
|---|---|
| wx.request | Initiates an HTTPS network request |
RequestTask
| API Name | Description |
|---|---|
| RequestTask.abort | Interrupt the request task |
| RequestTask.offChunkReceived | Removes the listener function for the Transfer-Encoding Chunk Received event |
| RequestTask.offHeadersReceived | Removes the listener function for the HTTP Response Header event |
| RequestTask.onChunkReceived | Listens to the Transfer-Encoding Chunk Received event |
| RequestTask.onHeadersReceived | Listens to the HTTP Response Header event |
Download
| API Name | Description |
|---|---|
| wx.downloadFile | Download file resources to local storage |
DownloadTask
| API Name | Description |
|---|---|
| DownloadTask.abort | Interrupt the download task |
| DownloadTask.offHeadersReceived | Remove the listener function for the HTTP Response Header event |
| DownloadTask.offProgressUpdate | Remove the listener function for the download progress change event |
| DownloadTask.onHeadersReceived | Listen for the HTTP Response Header event |
| DownloadTask.onProgressUpdate | Listen for the download progress change event |
Upload
| API Name | Description |
|---|---|
| wx.uploadFile | Uploads local resources to the server |
UploadTask
| API Name | Description |
|---|---|
| UploadTask.abort | Aborts the upload task |
| UploadTask.offHeadersReceived | Removes the listener function for the HTTP Response Header event |
| UploadTask.offProgressUpdate | Removes the listener function for the upload progress change event |
| UploadTask.onHeadersReceived | Listens to the HTTP Response Header event |
| UploadTask.onProgressUpdate | Listens to the upload progress change event |
WebSocket
| API Name | Description |
|---|---|
| wx.sendSocketMessage | Send data through the WebSocket connection |
| wx.onSocketOpen | Listen for the WebSocket connection open event |
| wx.onSocketMessage | Listen for the WebSocket message received from the server event |
| wx.onSocketError | Listen for the WebSocket error event |
| wx.onSocketClose | Listen for the WebSocket connection close event |
| wx.connectSocket | Create a WebSocket connection |
| wx.closeSocket | Close the WebSocket connection |
SocketTask
| API Name | Description |
|---|---|
| SocketTask.close | Closes the WebSocket connection |
| SocketTask.onClose | Listens to the WebSocket connection close event |
| SocketTask.onError | Listens to the WebSocket error event |
| SocketTask.onMessage | Listens to the WebSocket message received event |
| SocketTask.onOpen | Listens to the WebSocket connection open event |
| SocketTask.send | Sends data over the WebSocket connection |
mDNS
| API Name | Description |
|---|---|
| wx.stopLocalServiceDiscovery | Stop searching for mDNS services |
| wx.startLocalServiceDiscovery | Start searching for mDNS services on the local area network |
| wx.onLocalServiceResolveFail | Listen for the mDNS service resolution failure event |
| wx.onLocalServiceLost | Listen for the mDNS service leave event |
| wx.onLocalServiceFound | Listen for the mDNS service discovery event |
| wx.onLocalServiceDiscoveryStop | Listen for the mDNS service stop search event |
| wx.offLocalServiceResolveFail | Remove the listener function for the mDNS service resolution failure event |
| wx.offLocalServiceLost | Remove the listener function for the mDNS service leave event |
| wx.offLocalServiceFound | Remove the listener function for the mDNS service discovery event |
| wx.offLocalServiceDiscoveryStop | Remove the listener function for the mDNS service stop search event |
TCP communication
| API Name | Description |
|---|---|
| wx.createTCPSocket | Creates a TCP Socket instance |
TCPSocket
| API Name | Description |
|---|---|
| TCPSocket.bindWifi | Binds the TCP Socket to the current Wi-Fi network. The onBindWifi event is trigg |
| TCPSocket.close | Closes the connection |
| TCPSocket.connect | Initiates a connection on the specified socket |
| TCPSocket.offBindWifi | Removes the listener function triggered when the socket successfully binds to th |
| TCPSocket.offClose | Removes the listener function triggered when the socket is fully closed |
| TCPSocket.offConnect | Removes the listener function triggered when the socket connection is successful |
| TCPSocket.offError | Removes the listener function triggered when an error occurs |
| TCPSocket.offMessage | Removes the listener function triggered when data is received |
| TCPSocket.onBindWifi | Listens to the event triggered when the socket successfully binds to the current |
| TCPSocket.onClose | Listens to the event triggered when the socket is fully closed |
| TCPSocket.onConnect | Listens to the event triggered when the socket connection is successfully establ |
| TCPSocket.onError | Listens to the event triggered when an error occurs |
| TCPSocket.onMessage | Listens to the event triggered when data is received |
| TCPSocket.write | Sends data over the socket |
UDP communication
| API Name | Description |
|---|---|
| wx.createUDPSocket | Creates a UDP Socket instance |
UDPSocket
| API Name | Description |
|---|---|
| UDPSocket.bind | Binds to a system-assigned available port or a specified port number |
| UDPSocket.close | Closes the UDP Socket instance, equivalent to destroying it |
| UDPSocket.connect | Pre-connects to the specified IP and port. Must be used in conjunction with the |
| UDPSocket.offClose | Removes the listener function for the close event |
| UDPSocket.offError | Removes the listener function for the error event |
| UDPSocket.offListening | Removes the listener function for the event triggered when listening for packet |
| UDPSocket.offMessage | Removes the listener function for the message received event |
| UDPSocket.onClose | Listens to the close event |
| UDPSocket.onError | Listens to the error event |
| UDPSocket.onListening | Listens to the event triggered when listening for packet messages begins |
| UDPSocket.onMessage | Listens to the message received event |
| UDPSocket.send | Sends a message to the specified IP and port |
| UDPSocket.setTTL | Sets the IP_TTL socket option, used to specify the maximum number of hops allowe |
| UDPSocket.write | Usage is identical to the send method. If connect has not been called in advance |
Payment
| API Name | Description |
|---|---|
| wx.verifyHKPaymentPassword | Invoke the WeChat Pay HK password verification component. |
| wx.requestVirtualPayment | Initiate Mi Dashi virtual payment. |
| wx.requestPluginPayment | Initiate payment in a plugin. |
| wx.requestPayment | Initiate WeChat Pay. |
| wx.requestOrderPayment | Only required for Mini Program that have integrated the Custom Transaction Compo |
| wx.requestMerchantTransfer | In the Merchant Transfer User Confirmation mode, invoke the page via Mini Progra |
| wx.requestCommonPayment | Initiate general payment |
| wx.requestAppleSubscribeSign | Initiate Apple subscription agreement |
| wx.openHKOfflinePayView | Launch the WeChat Pay HK payment code |
| wx.jumpToOfflinePay | Navigate to the offline payment page |
| wx.createGlobalPayment | Create an object for the global payment method |
GlobalPayment
| API Name | Description |
|---|---|
| GlobalPayment.abort | The user selects the TPG payment method, and the interface enters a loading Toas |
| GlobalPayment.openMethodPicker | Launch the payment method selection panel for Global Cashier |
| GlobalPayment.requestGlobalPayment | After the developer calls openMethodPicker and receives in the return value meth |
Data Cache
| API Name | Description |
|---|---|
| wx.setStorageSync | Store data under a specified key in local cache |
| wx.setStorage | Store data under a specified key in local cache |
| wx.revokeBufferURL | Destroy data in memory based on the URL |
| wx.removeStorageSync | Synchronous version of wx.removeStorage |
| wx.removeStorage | Remove the specified key from local cache |
| wx.getStorageSync | Synchronously retrieve the contents of a specified key from local cache |
| wx.getStorageInfoSync | Synchronous version of wx.getStorageInfo |
| wx.getStorageInfo | Asynchronously retrieve information about the current storage |
| wx.getStorage | Asynchronously retrieve the contents of a specified key from local cache |
| wx.createBufferURL | Create a unique URL in memory based on the passed buffer |
| wx.clearStorageSync | Synchronous version of wx.clearStorage |
| wx.clearStorage | Clear local data cache |
| wx.batchSetStorageSync | Batch store data under specified keys in local cache |
| wx.batchSetStorage | Batch store data under specified keys in local cache |
| wx.batchGetStorageSync | Synchronously batch retrieve the contents of specified keys from local cache |
| wx.batchGetStorage | Asynchronously batch retrieve the contents of specified keys from local cache |
Data pre-fetching and periodic updates.
| API Name | Description |
|---|---|
| wx.setBackgroundFetchToken | Set the custom login state to be included during periodic data fetching, facilit |
| wx.onBackgroundFetchData | Listen to the event of receiving backgroundFetch data. |
| wx.getBackgroundFetchToken | Get the configured custom login state. |
| wx.getBackgroundFetchData | Retrieve backgroundFetch client cached data. |
Cache Manager
| API Name | Description |
|---|---|
| wx.createCacheManager | Create a cache manager |
CacheManager
| API Name | Description |
|---|---|
| CacheManager.addRule | Add a rule. |
| CacheManager.addRules | Batch add rules. For rule syntax, refer to CacheManager.addRule. |
| CacheManager.clearCaches | Clear all cache. |
| CacheManager.clearRules | Clear all rules, which also deletes all cache under the corresponding rules. |
| CacheManager.deleteCache | Delete cache |
| CacheManager.deleteCaches | Batch delete cache |
| CacheManager.deleteRule | Delete a rule, which also deletes all caches under that rule |
| CacheManager.deleteRules | Batch delete rules, which also deletes all caches under those rules |
| CacheManager.match | Matches hit cache rules; generally used in conjunction with the request event |
| CacheManager.off | Cancel event listener |
| CacheManager.on | Listen for events |
| CacheManager.start | Enable cache; only effective when mode is none. After the call, the state of the |
| CacheManager.stop | Disable cache; only effective when mode is none. After the call, the state of th |
Data analytics
| API Name | Description |
|---|---|
| wx.reportMonitor | Custom business data monitoring reporting interface |
| wx.reportEvent | Event reporting |
| wx.reportAnalytics | Custom analytics data reporting interface |
| wx.getExptInfoSync | Given an experiment parameter array, retrieve the corresponding experiment param |
| wx.getCommonConfig | Retrieves the corresponding experiment parameter values given an array of experi |
Canvas
| API Name | Description |
|---|---|
| wx.createOffscreenCanvas | Creates an offscreen canvas instance |
| wx.createCanvasContext | Creates a Canvas drawing context CanvasContext object |
| wx.canvasToTempFilePath | Exports the content of a specified area of the current canvas to generate an ima |
| wx.canvasPutImageData | Draws pixel data onto the canvas |
| wx.canvasGetImageData | Retrieves the implied pixel data of the canvas area |
| Color | Color |
| Image | Image object |
| ImageData | ImageData object |
| RenderingContext | Canvas drawing context |
Canvas
| API Name | Description |
|---|---|
| Canvas.cancelAnimationFrame | Cancels an animation frame request that was added to the schedule by requestAnim |
| Canvas.createImage | Creates an image object. |
| Canvas.createImageData | Creates an ImageData object. |
| Canvas.createPath2D | Creates a Path2D object. |
| Canvas.getContext | This method returns the drawing context of the Canvas. |
| Canvas.requestAnimationFrame | Executes at the next redraw. |
| Canvas.toDataURL | Returns a data URI containing the image representation. |
CanvasContext
| API Name | Description |
|---|---|
| CanvasContext.arc | Creates an arc. |
| CanvasContext.arcTo | Draws an arc path based on control points and radius. |
| CanvasContext.beginPath | Starts creating a path. |
| CanvasContext.bezierCurveTo | Creates a cubic Bézier curve path. |
| CanvasContext.clearRect | Clears the content within the specified rectangular area on the canvas. |
| CanvasContext.clip | Cuts out a shape and size of any dimension from the original canvas. |
| CanvasContext.closePath | Closes a path. |
| CanvasContext.createCircularGradient | Creates a radial gradient. |
| CanvasContext.createLinearGradient | Creates a linear gradient. |
| CanvasContext.createPattern | Wait, checking translation: "Creates a pattern using the specified image, allowi |
| CanvasContext.draw | Strokes the current path (including paths, transformations, and styles) onto the |
| CanvasContext.drawImage | Draws an image onto the canvas. |
| CanvasContext.fill | Fills the content of the current path. |
| CanvasContext.fillRect | Fills a rectangle. |
| CanvasContext.fillText | Draws filled text on the canvas. |
| CanvasContext.lineTo | Adds a new point and creates a line from the last specified point to the target |
| CanvasContext.measureText | Measures the size information of text. |
| CanvasContext.moveTo | Moves the path to the specified point on the canvas without creating a line. |
| CanvasContext.quadraticCurveTo | Creates a quadratic Bézier curve path. |
| CanvasContext.rect | Creates a rectangular path. |
| CanvasContext.restore | Restores the previously saved drawing context. |
| CanvasContext.rotate | Rotates the current coordinate axes clockwise around the origin. |
| CanvasContext.save | Saves the drawing context. |
| CanvasContext.scale | After calling this method, the horizontal and vertical coordinates of subsequent |
| CanvasContext.setFillStyle | Sets the fill color. |
| CanvasContext.setFontSize | Sets the font size. |
| CanvasContext.setGlobalAlpha | Sets the global alpha transparency. |
| CanvasContext.setLineCap | Sets the line cap style |
| CanvasContext.setLineDash | Sets the dash style |
| CanvasContext.setLineJoin | Sets the line join style |
| CanvasContext.setLineWidth | Sets the line width |
| CanvasContext.setMiterLimit | Sets the maximum miter length |
| CanvasContext.setShadow | Sets the shadow style |
| CanvasContext.setStrokeStyle | Sets the stroke color |
| CanvasContext.setTextAlign | Sets the text alignment |
| CanvasContext.setTextBaseline | Sets the vertical text alignment |
| CanvasContext.setTransform | Method to reset (override) the current transform using a matrix |
| CanvasContext.stroke | Draws the outline of the current path |
| CanvasContext.strokeRect | Draws a rectangle (unfilled) |
| CanvasContext.strokeText | Method to draw text outline at the specified (x, y) position |
| CanvasContext.transform | Method to apply multiple transforms to the current transform using matrices |
| CanvasContext.translate | Transforms the origin (0, 0) of the current coordinate system |
CanvasGradient
| API Name | Description |
|---|---|
| CanvasGradient.addColorStop | Adds a gradient stop |
OffscreenCanvas
| API Name | Description |
|---|---|
| OffscreenCanvas.createImage | Creates an Image object |
| OffscreenCanvas.getContext | This method returns the drawing context of the OffscreenCanvas |
Path2D
| API Name | Description |
|---|---|
| Path2D.addPath | Adds a path to the current path |
| Path2D.arc | Adds an arc path segment |
| Path2D.arcTo | Adds an arc path segment through the specified control points |
| Path2D.bezierCurveTo | Adds a cubic Bezier curve path |
| Path2D.closePath | Closes the path to the starting point |
| Path2D.ellipse | Adds an elliptical arc path |
| Path2D.lineTo | Adds a straight line path |
| Path2D.moveTo | Moves the path start point |
| Path2D.quadraticCurveTo | Adds a quadratic Bezier curve path |
| Path2D.rect | Adds a rectangle path |
Media
Map
| API Name | Description |
|---|---|
| wx.createMapContext | Create a map context MapContext object |
MapContext
| API Name | Description |
|---|---|
| MapContext.addArc | Add arc line. You must set either waypoints or the included angle. |
| MapContext.addCustomLayer | Add custom layer |
| MapContext.addGroundOverlay | Create a custom image layer. The image will scale with the map zoom level. |
| MapContext.addMarkers | Add a marker |
| MapContext.addVisualLayer | Add a visualization layer |
| MapContext.eraseLines | Erase or gray out line segments added to the map |
| MapContext.executeVisualLayerCommand | Execute visualization layer commands, used in conjunction with event listeners |
| MapContext.fromScreenLocation | Get the latitude and longitude corresponding to a point on the screen, with the |
| MapContext.getCenterLocation | Get the latitude and longitude of the current map center |
| MapContext.getRegion | Get the current map viewport range |
| MapContext.getRotate | Get the current map rotation angle |
| MapContext.getScale | Get the current map zoom level |
| MapContext.getSkew | Get the current map pitch angle |
| MapContext.includePoints | Zoom the viewport to display all specified latitude and longitude points |
| MapContext.initMarkerCluster | Initialize cluster configuration; default configuration is used if not called |
| MapContext.moveAlong | Move along a specified path, used for scenarios such as trajectory playback |
| MapContext.moveToLocation | Move the map center to the current location; the map component's show-location p |
| MapContext.on | Listen to map events |
| MapContext.openMapApp | Launch the map app to select a navigation route |
| MapContext.removeArc | Remove an arc |
| MapContext.removeCustomLayer | Remove a personalized layer |
| MapContext.removeGroundOverlay | Remove a custom image layer |
| MapContext.removeMarkers | Remove a marker |
| MapContext.removeVisualLayer | Remove a visualization layer |
| MapContext.setBoundary | Restrict the map's display range |
| MapContext.setCenterOffset | Set the map center point offset; positive values indicate movement to the right |
| MapContext.setLocMarkerIcon | Set the location point icon, supporting network paths, local paths, and code pac |
| MapContext.toScreenLocation | Get the screen coordinates corresponding to latitude and longitude, with the ori |
| MapContext.translateMarker | Translate a marker with animation |
| MapContext.updateGroundOverlay | Update a custom image layer |
Image
| API Name | Description |
|---|---|
| wx.saveImageToPhotosAlbum | Save Image to System Album |
| wx.previewMedia | Preview Images and Videos |
| wx.previewImage | Preview Image Fullscreen in a New Page |
| wx.getImageInfo | Get Image Info |
| wx.editImage | Edit Image API |
| wx.cropImage | Crop Image API |
| wx.compressImage | Compress Image API with Optional Quality |
| wx.chooseMessageFile | Select File from Client Session |
| wx.chooseImage | Choose Image from Local Album or Take a Photo |
Video
| API Name | Description |
|---|---|
| wx.saveVideoToPhotosAlbum | Save a video to the system album |
| wx.saveMediaToPhotosAlbum | Save an image or video to the system album |
| wx.openVideoEditor | Open the video editor |
| wx.getVideoInfo | Get detailed video information |
| wx.createVideoContext | Create a video context VideoContext object |
| wx.compressVideo | Video Compression Interface |
| wx.chooseVideo | Capture a video or select a video from the phone album |
| wx.chooseMedia | Capture or select an image or video from the phone album |
| wx.checkDeviceSupportHevc | Check if the device supports H.265 encoding |
VideoContext
| API Name | Description |
|---|---|
| VideoContext.exitBackgroundPlayback | Exit background small window playback mode |
| VideoContext.exitCasting | Exit screen mirroring |
| VideoContext.exitFullScreen | Exit fullscreen |
| VideoContext.exitPictureInPicture | Exit small window. This method can be called on any page. |
| VideoContext.hideStatusBar | Hide the status bar. Valid only in iOS fullscreen mode. |
| VideoContext.pause | Pause Video |
| VideoContext.play | Play Video |
| VideoContext.playbackRate | Set playback speed |
| VideoContext.reconnectCasting | Reconnect to the screen mirroring device |
| VideoContext.requestBackgroundPlayback | Enter background small window playback mode |
| VideoContext.requestFullScreen | Enter fullscreen |
| VideoContext.seek | Seek to a specified position |
| VideoContext.sendDanmu | Send bullet comments |
| VideoContext.showStatusBar | Show the status bar. Valid only in iOS fullscreen mode. |
| VideoContext.startCasting | Start screen mirroring. Launches a half-screen device search interface. |
| VideoContext.stop | Stop Video |
| VideoContext.switchCasting | Switch screen mirroring device |
Audio
| API Name | Description |
|---|---|
| wx.stopVoice | Stop the playing speech |
| wx.setInnerAudioOption | Set the playback options for InnerAudioContext |
| wx.playVoice | Start playing speech |
| wx.pauseVoice | Pause the playing speech |
| wx.getAvailableAudioSources | Get the currently supported audio input sources |
| wx.createWebAudioContext | Create a WebAudio context |
| wx.createMediaAudioPlayer | Create a media audio player object MediaAudioPlayer object, which can be used to |
| wx.createInnerAudioContext | Create an internal audio context InnerAudioContext object |
| wx.createAudioContext | Create an audio context AudioContext object |
| AudioListener | A spatial audio listener, representing a unique position and orientation within |
| AudioParam | The AudioParam interface represents audio-related parameters, typically paramete |
| WebAudioContextNode | A class of audio processing modules; different Nodes have different functions, s |
AudioBuffer
| API Name | Description |
|---|---|
| AudioBuffer.copyFromChannel | Copies the specified channel from the AudioBuffer to the end of the array. |
| AudioBuffer.copyToChannel | Copies samples from the specified array to the specific channel of the audioBuff |
| AudioBuffer.getChannelData | Returns a Float32Array containing PCM data with channels, defined by the channel |
AudioContext
| API Name | Description |
|---|---|
| AudioContext.pause | Pause the audio. |
| AudioContext.play | Play the audio. |
| AudioContext.seek | Jump to a specified position. |
| AudioContext.setSrc | Set the audio source URL. |
BufferSourceNode
| API Name | Description |
|---|---|
| BufferSourceNode.connect | Connects to a specified destination. |
| BufferSourceNode.disconnect | Disconnects from the connected destination node. |
| BufferSourceNode.start | The audio source starts playing. |
| BufferSourceNode.stop | Stop playback. |
InnerAudioContext
| API Name | Description |
|---|---|
| InnerAudioContext.destroy | Destroy the current instance. |
| InnerAudioContext.offCanplay | Removes the listener function for the event triggered when the audio enters a pl |
| InnerAudioContext.offEnded | Removes the listener function for the event triggered when the audio naturally p |
| InnerAudioContext.offError | Removes the listener function for the audio playback error event. |
| InnerAudioContext.offPause | Removes the listener function for the audio pause event. |
| InnerAudioContext.offPlay | Removes the listener function for the audio play event. |
| InnerAudioContext.offSeeked | Removes the listener function for the event triggered when the audio completes a |
| InnerAudioContext.offSeeking | Removes the listener function for the event triggered when the audio performs a |
| InnerAudioContext.offStop | Removes the listener function for the audio stop event. |
| InnerAudioContext.offTimeUpdate | Removes the listener function for the audio playback progress update event. |
| InnerAudioContext.offWaiting | Removes the listener function for the audio loading event. |
| InnerAudioContext.onCanplay | Listens for the event when the audio enters a playable state. |
| InnerAudioContext.onEnded | Listens for the event when the audio naturally plays to the end. |
| InnerAudioContext.onError | Listens for the audio playback error event. |
| InnerAudioContext.onPause | Listens for the audio pause event. |
| InnerAudioContext.onPlay | Listens for the audio play event. |
| InnerAudioContext.onSeeked | Listens for the event when the audio completes a seek operation. |
| InnerAudioContext.onSeeking | Listens for the event when the audio performs a seek operation. |
| InnerAudioContext.onStop | Listens for the audio stop event. |
| InnerAudioContext.onTimeUpdate | Listens for the audio playback progress update event. |
| InnerAudioContext.onWaiting | Listens for the audio loading event. |
| InnerAudioContext.pause | Pause |
| InnerAudioContext.play | Play |
| InnerAudioContext.seek | Jump to a specified position. |
| InnerAudioContext.stop | Stop |
MediaAudioPlayer
| API Name | Description |
|---|---|
| MediaAudioPlayer.addAudioSource | Add an audio source. |
| MediaAudioPlayer.destroy | Destroy the player. |
| MediaAudioPlayer.removeAudioSource | Remove the audio source. |
| MediaAudioPlayer.start | Start the player |
| MediaAudioPlayer.stop | Stop the player |
WebAudioContext
| API Name | Description |
|---|---|
| WebAudioContext.close | Close the WebAudioContext |
| WebAudioContext.createAnalyser | Create an AnalyserNode |
| WebAudioContext.createBiquadFilter | Create a BiquadFilterNode |
| WebAudioContext.createBuffer | Create an AudioBuffer, which represents a short audio segment residing in memory |
| WebAudioContext.createBufferSource | Create a BufferSourceNode instance to play audio data via an AudioBuffer object |
| WebAudioContext.createChannelMerger | Create a ChannelMergerNode |
| WebAudioContext.createChannelSplitter | Create a ChannelSplitterNode |
| WebAudioContext.createConstantSource | Create a ConstantSourceNode |
| WebAudioContext.createDelay | Create a DelayNode |
| WebAudioContext.createDynamicsCompressor | Create a DynamicsCompressorNode |
| WebAudioContext.createGain | Create a GainNode |
| WebAudioContext.createIIRFilter | Create an IIRFilterNode |
| WebAudioContext.createOscillator | Create an OscillatorNode |
| WebAudioContext.createPanner | Create a PannerNode |
| WebAudioContext.createPeriodicWave | Create a PeriodicWaveNode |
| WebAudioContext.createScriptProcessor | Create a ScriptProcessorNode |
| WebAudioContext.createWaveShaper | Create a WaveShaperNode |
| WebAudioContext.decodeAudioData | Asynchronously decode a resource into an AudioBuffer |
| WebAudioContext.resume | Synchronously resume a paused WebAudioContext |
| WebAudioContext.suspend | Synchronously pause the WebAudioContext |
Background audio
| API Name | Description |
|---|---|
| wx.stopBackgroundAudio | Stop Music Playback |
| wx.seekBackgroundAudio | Control Music Playback Progress |
| wx.playBackgroundAudio | Play Music Using the Background Player |
| wx.pauseBackgroundAudio | Pause Music Playback |
| wx.onBackgroundAudioStop | Listen for Music Stop Event |
| wx.onBackgroundAudioPlay | Listen for Music Play Event |
| wx.onBackgroundAudioPause | Listen for Music Pause Event |
| wx.getBackgroundAudioPlayerState | Get Background Music Playback Status |
| wx.getBackgroundAudioManager | Get the globally unique background audio manager |
BackgroundAudioManager
| API Name | Description |
|---|---|
| BackgroundAudioManager.onCanplay | Listen for the event when background audio becomes playable |
| BackgroundAudioManager.onEnded | Listen for the event when background audio finishes playing naturally |
| BackgroundAudioManager.onError | Listen for the background audio playback error event |
| BackgroundAudioManager.onNext | Listen for the event when the user taps the next track button in the system musi |
| BackgroundAudioManager.onPause | Listen for the background audio pause event |
| BackgroundAudioManager.onPlay | Listen for the background audio playback event |
| BackgroundAudioManager.onPrev | Listen for the event when the user taps the previous track button in the system |
| BackgroundAudioManager.onSeeked | Listen for the event when background audio completes a track switching operation |
| BackgroundAudioManager.onSeeking | Listen for the event when background audio starts a track switching operation |
| BackgroundAudioManager.onStop | Listen for the background audio stop event |
| BackgroundAudioManager.onTimeUpdate | Listen for the background audio playback progress update event, which is only in |
| BackgroundAudioManager.onWaiting | Listen for the audio loading event |
| BackgroundAudioManager.pause | Pause the music |
| BackgroundAudioManager.play | Play the music |
| BackgroundAudioManager.seek | Jump to a specified position |
| BackgroundAudioManager.stop | Stop the music |
Real-time Audio and Video
| API Name | Description |
|---|---|
| wx.createLivePusherContext | Create a live-pusher context LivePusherContext object |
| wx.createLivePlayerContext | Create a live-player context LivePlayerContext object |
LivePlayerContext
| API Name | Description |
|---|---|
| LivePlayerContext.exitBackgroundPlayback | Exit Background PIP Playback Mode |
| LivePlayerContext.exitCasting | Exit Screen Mirroring |
| LivePlayerContext.exitFullScreen | Exit fullscreen |
| LivePlayerContext.exitPictureInPicture | Exit small window mode. This method can be called on any page. |
| LivePlayerContext.mute | Mute |
| LivePlayerContext.pause | Pause |
| LivePlayerContext.play | Play |
| LivePlayerContext.reconnectCasting | Reconnect to the screen casting device |
| LivePlayerContext.requestBackgroundPlayback | Enter background small window playback mode |
| LivePlayerContext.requestFullScreen | Enter fullscreen |
| LivePlayerContext.resume | Resume |
| LivePlayerContext.snapshot | Screenshot |
| LivePlayerContext.startCasting | Start screen casting and launch the half-screen device search |
| LivePlayerContext.stop | Stop |
| LivePlayerContext.switchCasting | Switch screen casting device |
LivePusherContext
Audio recording
| API Name | Description |
|---|---|
| wx.stopRecord | Stop Recording |
| wx.startRecord | Start Recording |
| wx.getRecorderManager | Get the globally unique recorder manager RecorderManager |
RecorderManager
| API Name | Description |
|---|---|
| RecorderManager.onError | Listen to audio recording error events |
| RecorderManager.onFrameRecorded | Listen to events where a file of the specified frame size has been recorded |
| RecorderManager.onInterruptionBegin | Listen to events where audio recording is interrupted due to system usage |
| RecorderManager.onInterruptionEnd | Listen to audio recording interruption end events |
| RecorderManager.onPause | Listen to audio recording pause events |
| RecorderManager.onResume | Listen to audio recording resume events |
| RecorderManager.onStart | Listen to audio recording start events |
| RecorderManager.onStop | Listen to audio recording end events |
| RecorderManager.pause | Pause audio recording |
| RecorderManager.resume | Resume audio recording |
| RecorderManager.start | Start audio recording |
| RecorderManager.stop | Stop Recording |
Camera
| API Name | Description |
|---|---|
| wx.createCameraContext | Create camera Context CameraContext Object |
CameraContext
| API Name | Description |
|---|---|
| CameraContext.onCameraFrame | Get Real-time Frame Data from the Camera |
| CameraContext.setZoom | Set Zoom Level |
| CameraContext.startRecord | Start Video Recording |
| CameraContext.stopRecord | Stop Video Recording |
| CameraContext.takePhoto | Take a Photo |
CameraFrameListener
| API Name | Description |
|---|---|
| CameraFrameListener.start | Start Listening to Frame Data |
| CameraFrameListener.stop | Stop Listening to Frame Data |
Rich Text
EditorContext
| API Name | Description |
|---|---|
| EditorContext.blur | Blur the Editor and Close the Keyboard |
| EditorContext.clear | Clear Editor Content |
| EditorContext.deleteText | Delete Content in the Specified Selection |
| EditorContext.format | Modify Styles |
| EditorContext.getBounds | Get the Position and Size of the Specified Selection |
| EditorContext.getContents | Get Editor Content |
| EditorContext.getHistoryState | Get History State |
| EditorContext.getSelection | Get Current Selection |
| EditorContext.getSelectionText | Get Plain Text Content of the Current Selection |
| EditorContext.insertCustomBlock | Insert Custom Block |
| EditorContext.insertDivider | Insert Divider |
| EditorContext.insertImage | Insert Image |
| EditorContext.insertText | Replace Current Selection with Text |
| EditorContext.redo | Redo |
| EditorContext.removeFormat | Clear Styles in Current Selection |
| EditorContext.scrollIntoView | Scroll the Editor Cursor to the Visible Area of the Window |
| EditorContext.setContents | Initialize Editor Content; Only Delta is Effective if Both HTML and Delta Exist |
| EditorContext.setSelection | Set Current Selection |
| EditorContext.undo | Undo |
Audio and Video Synthesis
| API Name | Description |
|---|---|
| wx.createMediaContainer | Create an audio and video processing container, which can ultimately synthesize |
| MediaTrack | Can be obtained via MediaContainer.extractDataSource |
MediaContainer
| API Name | Description |
|---|---|
| MediaContainer.addTrack | Add an audio or video track to the container |
| MediaContainer.destroy | Destroy the container and release resources |
| MediaContainer.export | Merge the tracks in the container and export a video file |
| MediaContainer.extractDataSource | Separate tracks from the input video source |
| MediaContainer.removeTrack | Remove an audio or video track from the container |
Real-time Voice
| API Name | Description |
|---|---|
| wx.updateVoIPChatMuteConfig | Update real-time voice mute settings |
| wx.subscribeVoIPVideoMembers | Subscribe to video feed members |
| wx.setEnable1v1Chat | Start a Two-Person Call |
| wx.onVoIPVideoMembersChanged | Listen for the event of changes in the video status of real-time voice call memb |
| wx.onVoIPChatStateChanged | Listen for the event of changes in room status |
| wx.onVoIPChatSpeakersChanged | Listen for the event of changes in the call status of real-time voice call membe |
| wx.onVoIPChatMembersChanged | Listen for the event of changes in the online status of real-time voice call mem |
| wx.onVoIPChatInterrupted | Listen for the event of being passively disconnected from a real-time voice call |
| wx.offVoIPVideoMembersChanged | Remove the listener function for the event of changes in the video status of rea |
| wx.offVoIPChatStateChanged | Remove the listener function for the event of changes in room status |
| wx.offVoIPChatSpeakersChanged | Remove the listener function for the event of changes in the call status of real |
| wx.offVoIPChatMembersChanged | Remove the listener function for the event of changes in the online status of re |
| wx.offVoIPChatInterrupted | Remove the listener function for the event of being passively disconnected from |
| wx.joinVoIPChat | Join (Create) a real-time voice call. For more information, see Real-Time Voice |
| wx.join1v1Chat | Join (Create) a Two-Person Call |
| wx.exitVoIPChat | Exit (Destroy) Real-time Voice Call |
Screen recorder
| API Name | Description |
|---|---|
| wx.createMediaRecorder | Create a WebGL screen recorder, which can record frames rendered on WebGL and ex |
MediaRecorder
| API Name | Description |
|---|---|
| MediaRecorder.destroy | Destroy the recorder |
| MediaRecorder.off | Cancel listening to recording events |
| MediaRecorder.on | Register a callback function to listen for recording events |
| MediaRecorder.pause | Pause recording |
| MediaRecorder.requestFrame | Request the next frame for recording; starts recording the current frame after c |
| MediaRecorder.resume | Resume recording |
| MediaRecorder.start | Start recording |
| MediaRecorder.stop | End recording |
Video Decoder
| API Name | Description |
|---|---|
| wx.createVideoDecoder | Create a video decoder to retrieve decoded data frame by frame |
VideoDecoder
| API Name | Description |
|---|---|
| VideoDecoder.getFrameData | Get the decoded data of the next frame |
| VideoDecoder.off | Unsubscribe from recording events |
| VideoDecoder.on | Register a callback function to listen to recording events |
| VideoDecoder.remove | Remove the decoder |
| VideoDecoder.seek | Seek to a specific time point for decoding |
| VideoDecoder.start | Start Decoding |
| VideoDecoder.stop | Stop Decoding |
Location
| API Name | Description |
|---|---|
| wx.stopLocationUpdate | Stop listening for real-time location changes; message reception stops in both f |
| wx.startLocationUpdateBackground | Enable Mini Program to receive location messages in both foreground and backgrou |
| wx.startLocationUpdate | Enable Mini Program to receive location messages when in the foreground. |
| wx.openLocation | View location using the built-in WeChat map. |
| wx.onLocationChangeError | Triggered when the continuous location retrieval interface returns a failure. |
| wx.onLocationChange | Listens for real-time location change events. Must be used in conjunction with w |
| wx.offLocationChangeError | Triggered when the continuous location retrieval interface returns a failure. |
| wx.offLocationChange | Remove the listener function for real-time location change events |
| wx.getLocation | Retrieve the current location and speed |
| wx.getFuzzyLocation | Retrieve the current fuzzy location |
| wx.choosePoi | Open the POI list to select a location, supporting both fuzzy location (city-lev |
| wx.chooseLocation | Open the map to select a location |
File
| API Name | Description |
|---|---|
| wx.saveFileToDisk | Save a file from the file system to the user's disk, supported only on PC |
| wx.openDocument | Open a document in a new page |
| wx.getFileSystemManager | Retrieve the globally unique file manager |
| FileStats | Each FileStats object contains path and Stats |
| ReadResult | File read result |
| WriteResult | File write result |
FileSystemManager
Stats
| API Name | Description |
|---|---|
| Stats.isDirectory | Determine whether the current file is a directory |
| Stats.isFile | Determine whether the current file is a regular file |
Open Interface
Login
| API Name | Description |
|---|---|
| wx.pluginLogin | This API can only be called in Mini Program plugins. Invoke the API to obtain th |
| wx.login | Call the API to obtain the login credential (code) |
| wx.checkSession | Check whether the session_key for the login state has expired |
Account Information
| API Name | Description |
|---|---|
| wx.getAccountInfoSync | Get current account information |
User Information
| API Name | Description |
|---|---|
| wx.getUserProfile | Get user information |
| wx.getUserInfo | Get user information |
| UserInfo | User Information |
Authorization
| API Name | Description |
|---|---|
| wx.authorizeForMiniProgram | This API can only be called in the Mini Program plugin, usage is the same as wx. |
| wx.authorize | Initiate an authorization request to the user in advance |
Settings
| API Name | Description |
|---|---|
| wx.openSetting | Launch the Mini Program settings interface on the client, and return the result |
| wx.getSetting | Get the user's current settings |
| AuthSetting | User authorization settings; for details, refer to Permissions |
| SubscriptionsSetting | Subscription Message Settings |
Shipping Address
| API Name | Description |
|---|---|
| wx.chooseAddress | Get the user's shipping address |
Coupons
| API Name | Description |
|---|---|
| wx.openCard | View coupons in the WeChat Wallet |
| wx.addCard | Add coupons in bulk |
Invoices
| API Name | Description |
|---|---|
| wx.chooseInvoiceTitle | Select the user's invoice header |
| wx.chooseInvoice | Select an existing invoice from the user |
Biometric Authentication
| API Name | Description |
|---|---|
| wx.startSoterAuthentication | Initiate SOTER biometric authentication |
| wx.checkIsSupportSoterAuthentication | Get the SOTER biometric authentication methods supported by the device |
| wx.checkIsSoterEnrolledInDevice | API to check if biometric information such as fingerprints is enrolled on the de |
WeChat Sports
| API Name | Description |
|---|---|
| wx.shareToWeRun | Share data to WeChat Sports |
| wx.getWeRunData | Get the user's step count from WeChat Sports over the past 31 days |
Subscription Messages
| API Name | Description |
|---|---|
| wx.requestSubscribeMessage | Launch the Mini Program subscription message interface on the client, and return |
| wx.requestSubscribeDeviceMessage | Subscription device message API; invoking this displays an authorization dialog. |
WeChat Red Packet
| API Name | Description |
|---|---|
| wx.showRedPackage | Fetch the H5 red packet cover page |
WeChat Store
| API Name | Description |
|---|---|
| wx.openStoreOrderDetail | Open the WeChat Store order details page |
| wx.openStoreCouponDetail | Open the WeChat Store coupon details page |
| wx.getStoreTraceId | Get the WeChat Store tracking ID, used for standardized e-commerce ordering scen |
Favorites
| API Name | Description |
|---|---|
| wx.addVideoToFavorites | Favorite videos |
| wx.addFileToFavorites | Favorite files |
Employment Relationship
| API Name | Description |
|---|---|
| wx.requestSubscribeEmployeeMessage | After the user has bound the Employment Relationship with this Mini Program, the |
| wx.checkEmployeeRelation | Check the binding relationship between the Mini Program Employment Relationship |
| wx.bindEmployeeRelation | Invoke the Mini Program Employment Relationship feature binding dialog. If the u |
My Mini Program
| API Name | Description |
|---|---|
| wx.checkIsAddedToMyMiniProgram | Check whether Mini Program has been added to "My Mini Program " |
Face Detection
| API Name | Description |
|---|---|
| wx.requestFacialVerify | Perform biometric-based face verification for user real-name information |
| wx.checkIsSupportFacialRecognition | Check whether the current device supports facial recognition capabilities |
License Plate
| API Name | Description |
|---|---|
| wx.chooseLicensePlate | Select a license plate number |
Video Accounts
| API Name | Description |
|---|---|
| wx.reserveChannelsLive | Subscribe to a Video Account live stream |
| wx.openChannelsUserProfile | Open the Video Account homepage |
| wx.openChannelsLiveNoticeInfo | Open the Video Account live stream preview half-screen |
| wx.openChannelsLive | Open a Video Account live stream |
| wx.openChannelsEvent | Open a Video Account activity page |
| wx.openChannelsActivity | Open a Video Account video |
| wx.getChannelsShareKey | Get the sharing source of a Video Account live stream card or video card. This i |
| wx.getChannelsLiveNoticeInfo | Get Video Account live stream preview information |
| wx.getChannelsLiveInfo | Get Video Account live stream information |
Audio and Video Calls
| API Name | Description |
|---|---|
| wx.requestDeviceVoIP | Request user authorization for audio and video calls with a device (group) |
| wx.getDeviceVoIPList | Query the audio and video call device (group) information authorized by the curr |
WeChat Group
| API Name | Description |
|---|---|
| wx.getGroupEnterInfo | Get the Mini Program launch information in a WeChat group chat scenario |
Privacy Information Authorization
| API Name | Description |
|---|---|
| wx.requirePrivacyAuthorize | Simulate privacy API calls and trigger the privacy popup logic |
| wx.openPrivacyContract | Navigate to the privacy policy page |
| wx.onNeedPrivacyAuthorization | Listen for user authorization events required by privacy APIs |
| wx.getPrivacySetting | Query privacy authorization status |
WeChat Customer Service
| API Name | Description |
|---|---|
| wx.openCustomerServiceChat | Open WeChat Customer Service; this API can only be called after a click event oc |
WeChat Emojis
| API Name | Description |
|---|---|
| wx.openStickerSetView | Open an emoji album |
| wx.openStickerIPView | Open an emoji IP collection |
| wx.openSingleStickerView | Open a single emoji |
| wx.openDesignerProfile | Navigate to the Emoji Artist homepage |
Device
Bluetooth - General
| API Name | Description |
|---|---|
| wx.stopBluetoothDevicesDiscovery | Stops scanning for nearby BLE peripheral devices |
| wx.startBluetoothDevicesDiscovery | Starts scanning for nearby BLE peripheral devices |
| wx.openBluetoothAdapter | Initializes the Bluetooth module |
| wx.onBluetoothDeviceFound | Listens for the event of discovering new devices |
| wx.onBluetoothAdapterStateChange | Listens for the Bluetooth adapter status change event |
| wx.offBluetoothDeviceFound | Removes all listener functions for the event of discovering new devices |
| wx.offBluetoothAdapterStateChange | Removes all listener functions for the Bluetooth adapter status change event |
| wx.makeBluetoothPair | Pairs a Bluetooth device; only supported on Android |
| wx.isBluetoothDevicePaired | Checks whether a Bluetooth device is paired; only supported on Android |
| wx.getConnectedBluetoothDevices | Gets connected Bluetooth devices based on the primary service UUID |
| wx.getBluetoothDevices | Gets all Bluetooth devices found during the active period of the Bluetooth modul |
| wx.getBluetoothAdapterState | Gets the status of the local Bluetooth adapter |
| wx.closeBluetoothAdapter | Turns off the Bluetooth module |
Bluetooth - Low Energy Central Device
| API Name | Description |
|---|---|
| wx.writeBLECharacteristicValue | Write binary data to a characteristic of a Bluetooth Low Energy device |
| wx.setBLEMTU | Negotiate and set the Maximum Transmission Unit (MTU) for Bluetooth Low Energy |
| wx.readBLECharacteristicValue | Read binary data from a characteristic of a Bluetooth Low Energy device |
| wx.onBLEMTUChange | Listen for Bluetooth Low Energy Maximum Transmission Unit change events (trigger |
| wx.onBLEConnectionStateChange | Listen for Bluetooth Low Energy connection state change events |
| wx.onBLECharacteristicValueChange | Listen for characteristic value change events on a Bluetooth Low Energy device |
| wx.offBLEMTUChange | Remove the listener function for Bluetooth Low Energy Maximum Transmission Unit |
| wx.offBLEConnectionStateChange | Remove the listener function for Bluetooth Low Energy connection state change ev |
| wx.offBLECharacteristicValueChange | Remove all listener functions for characteristic value change events on a Blueto |
| wx.notifyBLECharacteristicValueChange | Enable the notify feature for characteristic value changes on a Bluetooth Low En |
| wx.getBLEMTU | Retrieve the Maximum Transmission Unit of a Bluetooth Low Energy device |
| wx.getBLEDeviceServices | Retrieve all services of a Bluetooth Low Energy device |
| wx.getBLEDeviceRSSI | Retrieve the signal strength (Received Signal Strength Indication, RSSI) of a Bl |
| wx.getBLEDeviceCharacteristics | Retrieve all characteristics within a specific service of a Bluetooth Low Energy |
| wx.createBLEConnection | Connect to a Bluetooth Low Energy device |
| wx.closeBLEConnection | Disconnect from a Bluetooth Low Energy device |
Bluetooth - Low Energy Peripheral Device
| API Name | Description |
|---|---|
| wx.onBLEPeripheralConnectionStateChanged | Listens for the connection or disconnection events of the current peripheral dev |
| wx.offBLEPeripheralConnectionStateChanged | Removes the listener function for the connection or disconnection events of the |
| wx.createBLEPeripheralServer | Sets up a local Bluetooth Low Energy (BLE) peripheral server; multiple instances |
BLEPeripheralServer
| API Name | Description |
|---|---|
| BLEPeripheralServer.addService | Add a service |
| BLEPeripheralServer.close | Close the current server |
| BLEPeripheralServer.offCharacteristicReadRequest | Remove the listener function for events where a connected device requests to rea |
| BLEPeripheralServer.offCharacteristicSubscribed | Remove the listener function for characteristic subscription events |
| BLEPeripheralServer.offCharacteristicUnsubscribed | Remove the listener function for characteristic unsubscription events |
| BLEPeripheralServer.offCharacteristicWriteRequest | Remove the listener function for events where a connected device requests to wri |
| BLEPeripheralServer.onCharacteristicReadRequest | Listen for events where a connected device requests to read the characteristic v |
| BLEPeripheralServer.onCharacteristicSubscribed | Listen for characteristic subscription events (iOS only) |
| BLEPeripheralServer.onCharacteristicUnsubscribed | Listen for characteristic unsubscription events (iOS only) |
| BLEPeripheralServer.onCharacteristicWriteRequest | Listen for events where a connected device requests to write to the characterist |
| BLEPeripheralServer.removeService | Remove a service |
| BLEPeripheralServer.startAdvertising | Start advertising a locally created peripheral device |
| BLEPeripheralServer.stopAdvertising | Stop advertising |
| BLEPeripheralServer.writeCharacteristicValue | Write a binary data value to a specified characteristic and notify the connected |
Bluetooth - Beacon
| API Name | Description |
|---|---|
| wx.stopBeaconDiscovery | Stops scanning for nearby Beacon devices |
| wx.startBeaconDiscovery | Starts scanning for nearby Beacon devices |
| wx.onBeaconUpdate | Listens for the Beacon device update event; only one listener can be registered |
| wx.onBeaconServiceChange | Listens for the Beacon service status change event; only one listener can be reg |
| wx.offBeaconUpdate | Removes all listener functions for the Beacon device update event |
| wx.offBeaconServiceChange | Removes all listener functions for the Beacon service status change event |
| wx.getBeacons | Gets all discovered Beacon devices |
| BeaconInfo | Beacon devices |
NFC Read/Write
| API Name | Description |
|---|---|
| wx.removeSecureElementPass | Delete a specific card from the device |
| wx.rechargeTransitCard | Available on Android only |
| wx.issueTransitCard | Available on Android only |
| wx.getTransitCardList | Available on Android only. |
| wx.getTransitCardInfo | Available on Android only. |
| wx.getTransitCardCPLC | Available on Android only. |
| wx.getSecureElementPasses | Get information about all cards on the device. |
| wx.getNFCAdapter | Get the NFC instance. |
| wx.deleteTransitCard | Available on Android only. |
| wx.checkTransitCardSupport | Available on Android only. |
| wx.canAddSecureElementPass | Determine whether the device supports adding this payment card. |
| wx.addPaymentPassGetCertificateData | Initiate the Apple Pay card addition process. Retrieve the certificate, nonce, a |
| wx.addPaymentPassFinish | Notify the client that card addition was successful. |
IsoDep
| API Name | Description |
|---|---|
| IsoDep.close | Disconnect |
| IsoDep.connect | Connect to an NFC tag |
| IsoDep.getHistoricalBytes | Get reset information |
| IsoDep.getMaxTransceiveLength | Get the maximum transfer length |
| IsoDep.isConnected | Check if a connection is established |
| IsoDep.setTimeout | Set the timeout duration |
| IsoDep.transceive | Send data |
MifareClassic
| API Name | Description |
|---|---|
| MifareClassic.close | Disconnect |
| MifareClassic.connect | Connect to an NFC tag |
| MifareClassic.getMaxTransceiveLength | Get the maximum transfer length |
| MifareClassic.isConnected | Check if a connection is established |
| MifareClassic.setTimeout | Set the timeout duration |
| MifareClassic.transceive | Send data |
MifareUltralight
| API Name | Description |
|---|---|
| MifareUltralight.close | Disconnect |
| MifareUltralight.connect | Connect to an NFC tag |
| MifareUltralight.getMaxTransceiveLength | Get the maximum transfer length |
| MifareUltralight.isConnected | Check if a connection is established |
| MifareUltralight.setTimeout | Set the timeout duration |
| MifareUltralight.transceive | Send data |
Ndef
| API Name | Description |
|---|---|
| Ndef.close | Disconnect. |
| Ndef.connect | Connect to an NFC tag. |
| Ndef.isConnected | Check if connected. |
| Ndef.offNdefMessage | Cancel listening for Ndef messages. |
| Ndef.onNdefMessage | Listen for Ndef messages. |
| Ndef.setTimeout | Set the timeout duration. |
| Ndef.writeNdefMessage | Rewrite the Ndef tag content. |
NfcA
| API Name | Description |
|---|---|
| NfcA.close | Disconnect. |
| NfcA.connect | Connect to an NFC tag. |
| NfcA.getAtqa | Get ATQA information. |
| NfcA.getMaxTransceiveLength | Get the maximum transmission length. |
| NfcA.getSak | Get SAK information. |
| NfcA.isConnected | Check if connected. |
| NfcA.setTimeout | Set the timeout duration. |
| NfcA.transceive | Send data. |
NFCAdapter
| API Name | Description |
|---|---|
| NFCAdapter.getIsoDep | Get an IsoDep instance. The instance supports read/write operations compliant wi |
| NFCAdapter.getMifareClassic | Get a MifareClassic instance. The instance supports read/write operations for MI |
| NFCAdapter.getMifareUltralight | Get a MifareUltralight instance. The instance supports read/write operations for |
| NFCAdapter.getNdef | Get the Ndef instance. The instance supports reading and writing NDEF data on ND |
| NFCAdapter.getNfcA | Get the NfcA instance. The instance supports reading and writing based on the NF |
| NFCAdapter.getNfcB | Get the NfcB instance. The instance supports reading and writing based on the NF |
| NFCAdapter.getNfcF | Get the NfcF instance. The instance supports reading and writing based on the NF |
| NFCAdapter.getNfcV | Get the NfcV instance. The instance supports reading and writing based on the NF |
| NFCAdapter.offDiscovered | Remove the listener function for NFC tags. |
| NFCAdapter.onDiscovered | Listen for NFC tags. |
| NFCAdapter.startDiscovery | - |
| NFCAdapter.stopDiscovery | - |
NfcB
| API Name | Description |
|---|---|
| NfcB.close | Disconnect. |
| NfcB.connect | Connect to an NFC tag. |
| NfcB.getMaxTransceiveLength | Get the maximum transmission length. |
| NfcB.isConnected | Check if connected. |
| NfcB.setTimeout | Set the timeout duration. |
| NfcB.transceive | Send data. |
NfcF
| API Name | Description |
|---|---|
| NfcF.close | Disconnect. |
| NfcF.connect | Connect to an NFC tag. |
| NfcF.getMaxTransceiveLength | Get the maximum transmission length. |
| NfcF.isConnected | Check if connected. |
| NfcF.setTimeout | Set the timeout duration. |
| NfcF.transceive | Send data. |
NfcV
| API Name | Description |
|---|---|
| NfcV.close | Disconnect. |
| NfcV.connect | Connect to an NFC tag. |
| NfcV.getMaxTransceiveLength | Get the maximum transmission length. |
| NfcV.isConnected | Check if connected. |
| NfcV.setTimeout | Set the timeout duration. |
| NfcV.transceive | Send data. |
Wi-Fi
| API Name | Description |
|---|---|
| wx.stopWifi | Close the Wi-Fi module |
| wx.startWifi | Initialize the Wi-Fi module |
| wx.setWifiList | Set related AP information in |
| wx.onWifiConnectedWithPartialInfo | Listen for the Wi-Fi connection event |
| wx.onWifiConnected | Listen for the Wi-Fi connection event |
| wx.onGetWifiList | Listen for the Wi-Fi list data event |
| wx.offWifiConnectedWithPartialInfo | Remove the listener function for the Wi-Fi connection event |
| wx.offWifiConnected | Remove the listener function for the Wi-Fi connection event |
| wx.offGetWifiList | Remove the listener function for the Wi-Fi list data event |
| wx.getWifiList | Request to get the Wi-Fi list |
| wx.getConnectedWifi | Get information about the connected Wi-Fi |
| wx.connectWifi | Connect to Wi-Fi |
| WifiInfo | Wi-Fi Information |
Calendar
| API Name | Description |
|---|---|
| wx.addPhoneRepeatCalendar | Adds a recurring event to the system calendar |
| wx.addPhoneCalendar | Adds an event to the system calendar |
Contacts
| API Name | Description |
|---|---|
| wx.chooseContact | Opens the phone address book to select a contact |
| wx.addPhoneContact | Adds a contact to the phone address book |
Accessibility
| API Name | Description |
|---|---|
| wx.checkIsOpenAccessibility | Check if visual accessibility features are enabled |
Battery
| API Name | Description |
|---|---|
| wx.onBatteryInfoChange | Listen for battery information change events; currently, only monitoring the swi |
| wx.offBatteryInfoChange | Remove the listener function for battery information change events |
| wx.getBatteryInfoSync | Synchronous version of wx.getBatteryInfo |
| wx.getBatteryInfo | Retrieve device battery information |
Clipboard
| API Name | Description |
|---|---|
| wx.setClipboardData | Sets the content of the system clipboard |
| wx.getClipboardData | Gets the content of the system clipboard |
NFC Host Card Emulation
| API Name | Description |
|---|---|
| wx.stopHCE | Close the NFC module |
| wx.startHCE | Initialize the NFC module |
| wx.sendHCEMessage | Send an NFC message |
| wx.onHCEMessage | Listen to the NFC device message reception event |
| wx.offHCEMessage | Remove the listener function for the NFC device message reception event |
| wx.getHCEState | Check if the current device supports HCE capabilities |
Network
| API Name | Description |
|---|---|
| wx.onNetworkWeakChange | Listen to the weak network status change event |
| wx.onNetworkStatusChange | Listen to the network status change event |
| wx.offNetworkWeakChange | Remove the listener function for the weak network status change event |
| wx.offNetworkStatusChange | Remove the listener function for the network status change event |
| wx.getNetworkType | Get the network type |
| wx.getLocalIPAddress | Get the LAN IP address |
Encryption
| API Name | Description |
|---|---|
| wx.getRandomValues | Gets a cryptographically secure random number |
Screen
| API Name | Description |
|---|---|
| wx.setVisualEffectOnCapture | Set the screen behavior during screenshots/screen recordings |
| wx.setScreenBrightness | Set screen brightness |
| wx.setKeepScreenOn | Set whether to keep the screen always on |
| wx.onUserCaptureScreen | Listen for the user-initiated screenshot event |
| wx.onScreenRecordingStateChanged | Listen for the user screen recording event |
| wx.onGeneratePoster | Listen for the event where the developer needs to generate a custom poster after |
| wx.offUserCaptureScreen | User-initiated screenshot event |
| wx.offScreenRecordingStateChanged | Remove the listener function for the user screen recording event |
| wx.offGeneratePoster | Event requiring the developer to generate a custom poster after the user takes a |
| wx.getScreenRecordingState | Check if the user is recording the screen |
| wx.getScreenBrightness | Get screen brightness |
Keyboard
| API Name | Description |
|---|---|
| wx.onKeyUp | Listen to the Mini Program global keyup event |
| wx.onKeyDown | Listen to the Mini Program global keydown event |
| wx.onKeyboardHeightChange | Listen to the keyboard height change event |
| wx.offKeyUp | Remove the listener function for the Mini Program global keyup event |
| wx.offKeyDown | Removes the listener function for the global Mini Program keyboard key press eve |
| wx.offKeyboardHeightChange | Remove the listener function for the keyboard height change event |
| wx.hideKeyboard | After focusing on input, textarea, etc. and the keyboard appears, calls this int |
| wx.getSelectedTextRange | Gets the cursor position of the input field after focusing on input, textarea, e |
Phone
| API Name | Description |
|---|---|
| wx.makePhoneCall | Make a call |
Accelerometer
| API Name | Description |
|---|---|
| wx.stopAccelerometer | Stop listening for acceleration data |
| wx.startAccelerometer | Start listening for acceleration data |
| wx.onAccelerometerChange | Listen for acceleration data events |
| wx.offAccelerometerChange | Remove the listener function for acceleration data events |
Compass
| API Name | Description |
|---|---|
| wx.stopCompass | Stops listening to compass data |
| wx.startCompass | Starts listening to compass data |
| wx.onCompassChange | Listens for the compass data change event |
| wx.offCompassChange | Removes the listener function for the compass data change event |
Device Orientation
| API Name | Description |
|---|---|
| wx.stopDeviceMotionListening | Stop listening for device orientation changes |
| wx.startDeviceMotionListening | Start listening for device orientation changes |
| wx.onDeviceMotionChange | Listen to the device orientation change event |
| wx.offDeviceMotionChange | Remove the listener function for the device orientation change event |
Gyroscope
| API Name | Description |
|---|---|
| wx.stopGyroscope | Stops listening to gyroscope data |
| wx.startGyroscope | Starts listening to gyroscope data |
| wx.onGyroscopeChange | Listens for the gyroscope data change event |
| wx.offGyroscopeChange | Removes the listener function for the gyroscope data change event |
Memory
| API Name | Description |
|---|---|
| wx.onMemoryWarning | Listen to the insufficient memory warning event |
| wx.offMemoryWarning | Remove the listener function for the insufficient memory warning event |
QR Code Scanning
| API Name | Description |
|---|---|
| wx.scanCode | Launch the client's scanning interface to scan a QR code |
SMS
| API Name | Description |
|---|---|
| wx.sendSms | Launch the phone's SMS sending interface |
Vibration
| API Name | Description |
|---|---|
| wx.vibrateShort | Trigger a short-duration vibration on the phone (15 ms) |
| wx.vibrateLong | Trigger a long-duration vibration on the phone (400 ms) |
AI
AI Inference
| API Name | Description |
|---|---|
| wx.getInferenceEnvInfo | Get the version of the general AI inference engine |
| wx.createInferenceSession | Create an AI Inference Session |
| Tensor | Tensor |
| Tensors | Tensors are key-value objects. The object keys are used as input/output names, a |
InferenceSession
| API Name | Description |
|---|---|
| InferenceSession.destroy | Destroy the InferenceSession instance |
| InferenceSession.offError | Unlisten to the model load failure event |
| InferenceSession.offLoad | Unlisten to the model load completion event |
| InferenceSession.onError | Listen to the model load failure event |
| InferenceSession.onLoad | Listen to the model load completion event |
| InferenceSession.run | Run inference |
Visual Algorithms
| API Name | Description |
|---|---|
| wx.isVKSupport | Check supported version |
| wx.createVKSession | Create a vision kit session object |
| VKBodyAnchor | Human body anchor |
| VKDepthAnchor | depth anchor |
| VKFaceAnchor | Face anchor |
| VKHandAnchor | Gesture anchor |
| VKMarkerAnchor | marker anchor |
| VKOCRAnchor | OCR anchor |
| VKOSDAnchor | OSD anchor |
| VKPlaneAnchor | Plane anchor. Supported only in v2 |
VKCamera
| API Name | Description |
|---|---|
| VKCamera.getProjectionMatrix | Get projection matrix |
VKFrame
| API Name | Description |
|---|---|
| VKFrame.getCameraBuffer | Get the current frame RGBA buffer |
| VKFrame.getCameraJpgBuffer | Get the current frame JPG information buffer |
| VKFrame.getCameraTexture | Get the current frame texture. Currently, only YUV textures are supported |
| VKFrame.getDepthBuffer | Get the depth map information buffer for each frame |
| VKFrame.getDisplayTransform | Get the texture adjustment matrix |
| VKFrame.getLegSegmentBuffer | Get the leg segmentation information buffer for each frame. Supported from Andro |
VKSession
| API Name | Description |
|---|---|
| VKSession.addMarker | Add a marker. Requires to be set to when calling wx.createVKSession |
| VKSession.addOSDMarker | Add an OSD marker (one-shot detection marker). Requires to be set to when call |
| VKSession.cancelAnimationFrame | Cancel a request for an animation frame added to the schedule by requestAnimatio |
| VKSession.destroy | Destroy the session |
| VKSession.detectBody | Static image human body keypoint detection |
| VKSession.detectDepth | Depth recognition |
| VKSession.detectFace | Static image face keypoint detection |
| VKSession.detectHand | Static image gesture keypoint detection |
| VKSession.getAllMarker | Get all markers. Requires to be set to when calling wx.createVKSession |
| VKSession.getAllOSDMarker | Get all OSD markers. Requires to be set to when calling wx.createVKSession |
| VKSession.getVKFrame | Get the frame object. Each call triggers a frame analysis process |
| VKSession.hitTest | Touch detection. In v1, only a single plane is supported (i.e., after hitTest ge |
| VKSession.off | Unlisten to session events |
| VKSession.on | Listen to session events |
| VKSession.removeMarker | Delete a marker. Requires to be set to when calling wx.createVKSession |
| VKSession.removeOSDMarker | Delete an OSD marker. Requires to be set to when calling wx.createVKSession |
| VKSession.requestAnimationFrame | Execute on the next redraw |
| VKSession.runOCR | Static image OCR detection |
| VKSession.setDepthOccRange | Update the depth occlusion Occ range. Requires to be passed when calling wx.cre |
| VKSession.start | Start the session |
| VKSession.stop | Stop the session |
| VKSession.update3DMode | Update 3D recognition related configuration. Requires / / to be used when cal |
| VKSession.updateMaskMode | Set cropping related configuration. Requires to be used when calling wx.createV |
| VKSession.updateOSDThreshold | Update OSD recognition accuracy. Requires to be set to when calling wx.createV |
Face Detection
| API Name | Description |
|---|---|
| wx.stopFaceDetect | Stop face detection |
| wx.initFaceDetect | Initialize face detection |
| wx.faceDetect | Face detection. You must initialize it using wx.initFaceDetect before use. It is |
Worker
| API Name | Description |
|---|---|
| wx.createWorker | Creates a Worker thread. |
Worker
| API Name | Description |
|---|---|
| Worker.getCameraFrameData | Retrieves the current frame image from the camera and returns ArrayBuffer data. |
| Worker.onError | Listens to Worker thread error events. |
| Worker.onMessage | Listens to events where the main thread/Worker thread sends messages to the curr |
| Worker.onProcessKilled | Listens to the event where the worker thread is reclaimed by the system (after e |
| Worker.postMessage | Sends messages to the main thread/Worker thread. |
| Worker.terminate | Terminates the current Worker thread. |
| Worker.testOnProcessKilled | Used to simulate the iOS ExperimentalWorker thread being reclaimed by the system |
WXML
| API Name | Description |
|---|---|
| wx.createSelectorQuery | Returns a SelectorQuery object instance |
| wx.createIntersectionObserver | Creates and returns an IntersectionObserver object instance |
IntersectionObserver
| API Name | Description |
|---|---|
| IntersectionObserver.disconnect | Stops listening. |
| IntersectionObserver.observe | Specifies the target node and starts listening for changes in the intersection s |
| IntersectionObserver.relativeTo | Uses a selector to specify a node as one of the reference areas |
| IntersectionObserver.relativeToViewport | Specifies the page display area as one of the reference areas |
MediaQueryObserver
| API Name | Description |
|---|---|
| MediaQueryObserver.disconnect | Stops listening |
| MediaQueryObserver.observe | Starts listening for changes in page media queries |
NodesRef
| API Name | Description |
|---|---|
| NodesRef.boundingClientRect | Adds a query request for the layout position of a node |
| NodesRef.context | Adds a query request for the Context object of a node |
| NodesRef.fields | Retrieves related information about a node |
| NodesRef.node | Retrieves the Node instance |
| NodesRef.ref | Retrieves the Ref object for the node, which can be used to manipulate the node |
| NodesRef.scrollOffset | Adds a query request for the scroll position of a node |
SelectionContext
| API Name | Description |
|---|---|
| SelectionContext.removeSelection | Clears the current selection range within the selection component |
| SelectionContext.selectRange | Actively sets the selection range within the selection component |
| SelectionContext.setBaseAndExtent | Actively sets the start and end points of the selection range within the selecti |
SelectorQuery
| API Name | Description |
|---|---|
| SelectorQuery.exec | Executes all requests |
| SelectorQuery.in | Changes the selection scope of the selector to inside the custom component |
| SelectorQuery.select | Selects the first node matching the selector under the current page |
| SelectorQuery.selectAll | Selects all nodes matching the selector under the current page |
| SelectorQuery.selectViewport | Selects the display area |
Third-Party Platform
| API Name | Description |
|---|---|
| wx.getExtConfigSync | Synchronous version of wx.getExtConfig |
| wx.getExtConfig | Get custom data fields from Third-Party Platform |
Skyline
| API Name | Description |
|---|---|
| OpenContainer | An OpenContainer instance, which can be obtained via SelectorQuery. |
DraggableSheetContext
| API Name | Description |
|---|---|
| DraggableSheetContext.scrollTo | Scroll to a specified position. |
Snapshot
| API Name | Description |
|---|---|
| Snapshot.takeSnapshot | Take a snapshot of the snapshot component subtree. |
TextNode
| API Name | Description |
|---|---|
| TextNode.getBoxesForRange | Get the layout box of each line within the specified text offset in the text ele |
Ads
| API Name | Description |
|---|---|
| wx.getShowSplashAdStatus | Get the display status of the cover ad component |
| wx.createRewardedVideoAd | Create a rewarded video ad component |
| wx.createInterstitialAd | Create an interstitial ad component |
InterstitialAd
| API Name | Description |
|---|---|
| InterstitialAd.destroy | Destroy the interstitial ad instance |
| InterstitialAd.load | Load an interstitial ad |
| InterstitialAd.offClose | Remove the listener function for the interstitial ad close event |
| InterstitialAd.offError | Remove the listener function for the interstitial ad error event |
| InterstitialAd.offLoad | Remove the listener function for the interstitial ad load event |
| InterstitialAd.onClose | Listen to the interstitial ad close event |
| InterstitialAd.onError | Listen to the interstitial ad error event |
| InterstitialAd.onLoad | Listen to the interstitial ad load event |
| InterstitialAd.show | Show the interstitial ad |
RewardedVideoAd
| API Name | Description |
|---|---|
| RewardedVideoAd.destroy | Destroy the rewarded video ad instance |
| RewardedVideoAd.load | Load a rewarded video ad |
| RewardedVideoAd.offClose | Remove the listener function for the event where the user clicks the button |
| RewardedVideoAd.offError | Remove the listener function for the rewarded video ad error event |
| RewardedVideoAd.offLoad | Remove the listener function for the rewarded video ad load event |
| RewardedVideoAd.onClose | Listen to the event where the user clicks the button |
| RewardedVideoAd.onError | Listen to the rewarded video ad error event |
| RewardedVideoAd.onLoad | Listen to the rewarded video ad load event |
| RewardedVideoAd.show | Show the rewarded video ad |