tencent cloud

All product documents
Tencent Cloud Super App as a Service
API Overview
Last updated: 2025-04-10 17:08:00
API Overview
Last updated: 2025-04-10 17:08:00

Basic

System capabilities

Name
Feature description
Minimum version
canIUse
Checks whether the APIs, callbacks, parameters, and components of the mini program are supported in the current version.
1.5.0
env
Environment variables.
1.5.1
Converts a Base64 string into an ArrayBuffer object.
1.5.1
Converts an ArrayBuffer object to a Base64 string.
1.5.1

System

Name
Feature description
Minimum version
Asynchronously gets system information.
1.5.0
Synchronously gets system information.
1.5.1
Asynchronously gets system information.
1.5.1
Gets window information.
1.5.1
Gets device settings.
1.5.0
Navigates to the system’s Bluetooth settings page.
1.5.1
Navigates to the app's authorization management page.
1.5.1
Gets the userAgent of the WebView component that loads the mini program.
1.5.1
Gets basic information of the device.
1.5.1
Gets basic information of the superapp.
1.5.1
Gets authorization settings of the superapp.
1.5.1

Update

Name
Feature description
Minimum version
Gets the global unique version update manager to manage mini program updates.
1.5.1
Forces the mini program to restart and use the new version.
1.5.0
Listens for the event of the update check request to the backend.
1.5.0
Listens for mini program update failure event.
1.5.0
Listens for mini program update event.
1.5.0

Mini program

Name
Feature description
Minimum version
Gets the parameters when the mini program starts up.
1.5.0
Gets the parameters when the mini program starts up.
1.5.1
onError
Listens for mini program error event.
1.5.0
offError
Removes the listener for mini program error event.
1.5.0
Listens for system theme change event.
1.5.0
Removes the listener for system theme change event.
1.5.0
Listens for the event when the mini program attempts to open a non-existent page.
1.5.1
Removes the listener for the event when the mini program attempts to open a non-existent page.
1.5.1
onAppShow
Listens for the event when the mini program switches to the frontend.
1.5.1
Removes the listener for the event when the mini program switches to the frontend.
1.5.1
onAppHide
Listens for the event when the mini program switches to the backend.
1.5.1
Removes the listener for the event when the mini program switches to the frontend.
1.5.1
Listens for unhandled Promise rejection event.
1.5.1
Removes the listener for unhandled Promise rejection event.
1.5.1

Debug

Name
Feature description
Minimum version
Sets whether to enable the debugging.
1.5.0
Gets the log manager object.
1.5.1
Outputs debug logs to the debug panel.
1.5.0
Outputs error logs to the debug panel.
1.5.0
Creates a new group in the debug panel.
1.5.0
Ends a group created by console.group.
1.5.0
Outputs info logs to the debug panel.
1.5.0
Outputs log messages to the debug panel.
1.5.0
Outputs warn logs to the debug panel.
1.5.0
Writes debug logs.
1.5.0
Writes info logs.
1.5.0
Writes log messages.
1.5.0
Writes warning logs.
1.5.0
Adds filter keywords.
1.5.16
Writes error logs.
1.5.16
Writes info logs.
1.5.16
Sets filter keywords.
1.5.16
Writes warning logs.
1.5.16

Navigation between pages within a mini program

Name
Feature description
Minimum version
switchTab
Navigates to the tab bar page and closes all other non-tab bar pages.
1.5.0
reLaunch
Closes all pages and opens a specified page in the app.
1.5.0
Closes the current page and navigates to a specific page within the app.
1.5.0
Retains the current page and navigates to a specific page within the app.
1.5.1
Closes the current page and returns to the previous page or a multi-level page.
1.5.0
Inter-page event communication channel.
1.5.1

Navigation between different mini programs

Name
Feature description
Minimum version
Exits the current mini program.
1.5.0
Opens another mini program.
1.5.0
Returns to the previous mini program. This API can be called successfully only when the current mini program is opened by another mini program.
1.5.1

Share

Name
Feature description
Minimum version
Hides the Share button on the current page.
1.5.0
Shows the Share button on the current page.
1.5.0
Updates the sharing properties.
1.5.0
Opens the pop-up window for image sharing.
1.5.35
onCopyUrl
Listens for the event triggered when the user taps the "Copy URL" button in the top-right menu.
1.5.35
Removes all listeners for event triggered when the user taps the "Copy URL" button in the top-right menu.
1.5.35

User interface

Interaction

Name
Feature description
Minimum version
Hides the loading prompt.
1.5.0
hideToast
Hides the message prompt.
1.5.0
Shows the action menu.
1.5.0
Shows the loading prompt.
1.5.0
showModal
Shows the modal dialog.
1.5.0
showToast
Shows the message prompt.
1.5.0
Enables a confirmation dialog when the user tries to navigate away from a page in the mini program.
1.5.1
Disables the confirmation dialog when the user tries to navigate away from a page in the mini program.
1.5.1

Navigation bar

Name
Feature description
Minimum version
Dynamically sets the title of the navigation bar for the current page.
1.5.0
Sets the color of the page navigation bar.
1.5.0
Hides the back to home button.
1.5.0
Shows navigation bar loading animation on the current page.
1.5.1
Hides navigation bar loading animation on the current page.
1.5.1

Background

Name
Feature description
Minimum version
Dynamically sets the background color of the window.
1.5.0
Dynamically sets the style for the drop-down background text or loading image.
1.5.0

Tab bar

Name
Feature description
Minimum version
Shows the tab bar.
1.5.0
Hides the tab bar.
1.5.0
Dynamically sets the overall style of the tab bar.
1.5.0
Dynamically sets the content of a certain item on the tab bar.
1.5.0
Shows the red dot in the top-right corner of a certain item on the tab bar.
1.5.0
Hides the red dot in the top-right corner of a certain item on the tab bar.
1.5.0
Adds text to the top-right corner of a certain item on the tab bar.
1.5.0
Removes the text from the top-right corner of a certain item on the tab bar.
1.5.0

Pull-to-refresh

Name
Feature description
Minimum version
Starts pull-to-refresh.
1.5.0
Stops pull-to-refresh.
1.5.0

Scroll

Name
Feature description
Minimum version
Scrolls the page to the target position, supporting both selector and scroll distance methods for positioning.
1.5.0
Scrolls an element to the top or bottom of the viewport.
1.5.0
Scrolls an element to the specified position, precise to the pixel.
1.5.0

Animation

Name
Feature description
Minimum version
Name
Creates an animation instance.
1.5.0
Sets the background color.
1.5.0
Sets the bottom value.
1.5.0
Exports the animation queue.
1.5.0
Sets the height.
1.5.0
Sets the left value.
1.5.0
Same as transform-function matrix.
1.5.0
Same as transform-function matrix3d.
1.5.0
Sets the opacity.
1.5.0
Sets the right value.
1.5.0
Rotates clockwise from the origin by a specified angle.
1.5.0
Rotates clockwise from a fixed axis by a specified angle.
1.5.0
Rotates clockwise from the x-axis by a specified angle.
1.5.0
Rotates clockwise from the y-axis by a specified angle.
1.5.0
Rotates clockwise from the z-axis by a specified angle.
1.5.0
Changes the scale.
1.5.0
Changes the scale in a 3D scene.
1.5.0
Change the x-axis scale.
1.5.0
Change the y-axis scale.
1.5.0
Change the z-axis scale.
1.5.0
Sets the x-axis and y-axis skew angle.
1.5.0
Sets the x-axis skew angle.
1.5.0
Sets the y-axis skew angle.
1.5.0
Indicate a set of animations is complete.
1.5.0
Sets the top value.
1.5.0
Translation.
1.5.0
Translates the X, Y, and Z coordinates.
1.5.0
Translates the x-axis.
1.5.0
Translates the y-axis.
1.5.0
Translates the z-axis.
1.5.0
Sets the width.
1.5.0



Custom components

Name
Feature description
Minimum version
nextTick
Delays certain operations to the next time slice.
1.5.0

Menu

Name
Feature description
Minimum version
Gets the layout position information of the menu button (capsule button in the top right corner).
1.5.0

Window

Name
Feature description
Minimum version
Listens for window size change event.
1.5.0
Removes the listener for window size change event.
1.5.1

Font

Name
Feature description
Minimum version
Dynamically loads web fonts.
1.5.0

Network‍

Make request

Name
Feature description
Minimum version
request
Makes an HTTPS network request.
1.5.0
Aborts the request task.
1.5.0
Listens for the Transfer-Encoding Chunk Received event.
1.5.1
Removes the listener for the Transfer-Encoding Chunk Received event.
1.5.1
Listens for the HTTP Response Header event.
1.5.0
Removes the listener for the HTTP Response Header event.
1.5.0

Upload

Name
Feature description
Minimum version
Uploads local resources to the server.
1.5.0
Aborts the upload task.
1.5.0
Listens for upload progress change event.
1.5.0
Removes the listener for the upload progress change event.
1.5.0
Listens for the HTTP Response Header event.
1.5.0
Removes the listener for the HTTP Response Header event.
1.5.0

Download

Name
Feature description
Minimum version
Downloads file resources to the local device. The client initiates an HTTPS GET request and returns the local temporary path of the file. The maximum allowed file size for a single download is 200 MB.
1.5.1
Aborts the download task.
1.5.1
Listens for download progress change event.
1.5.1
Removes the listener for download progress change event.
1.5.1
Listens for the HTTP Response Header event.
1.5.1
Removes the listener for the HTTP Response Header event.
1.5.1

WebSocket

Name
Feature description
Minimum version
Sends data using WebSocket connection. You need to call wx.connectSocket first and send data after the wx.onSocketOpen callback.
1.5.1
Listens for the WebSocket connection open event.
1.5.1
Listens for messages received from the server through WebSocket.
1.5.1
Listens for WebSocket error event.
1.5.1
Listens for the WebSocket connection close event.
1.5.1
Creates a WebSocket connection.
1.5.1
Closes the last WebSocket connection created via wx.connectSocket (singleton mode).
1.5.1
Closes the WebSocket connection associated with the current SocketTask instance.
1.5.0
Listens for the WebSocket connection close event.
1.5.0
Listens for WebSocket error event.
1.5.0
Listens for messages received from the server through WebSocket.
1.5.0
Listens for the WebSocket connection open event.
1.5.0
Sends data using WebSocket connection.
1.5.0

UDP communication

Name
Feature description
Minimum version
Creates a UDP Socket instance.
1.5.1
Binds to a system-assigned available port or a specified port number
1.5.1
Closes the UDP Socket instance.
1.5.1
Pre-connects to a specified IP and port, used together with the write method.
1.5.1
Listen for the close event.
1.5.1
Removes the listener for the close event.
1.5.1
Listens for the error event.
1.5.1
Removes the listener for the error event.
1.5.1
Listens for the event when starting to listen for data packet messages.
1.5.1
Removes the listener for the event when starting to listen for data packet messages.
1.5.1
Listens for the event of receiving a message.
1.5.1
Removes the listener for the event of receiving a message.
1.5.1
Sends a message to the specified IP and port.
1.5.1
Sets the IP_TTL socket option to specify the maximum number of hops allowed for an IP packet during transmission.
1.5.16
Same usage as UDPSocket.send.
1.5.16

TCP communication

Name
Feature description
Minimum version
Creates a TCP Socket instance.
1.5.1
Binds the TCP Socket to the current Wi-Fi network, triggering the onBindWifi event upon success (Android only)
1.5.1
Closes the connection.
1.5.1
Initiates a connection on the given socket.
1.5.1
Listens for the event triggered when the socket is fully closed.
1.5.1
Removes the listener for the event triggered when the socket is fully closed.
1.5.1
Listens for the event triggered when a socket connection is successfully established.
1.5.1
Removes the listener for the event triggered when a socket connection is successfully established.
1.5.1
Listens for the event triggered when an error occurs.
1.5.1
Removes the listener for the event triggered when an error occurs.
1.5.1
Listens for the event triggered when data is received.
1.5.1
Removes the listener for the event triggered when data is received.
1.5.1
Listens for the event triggered when a socket successfully binds to the current Wi-Fi network.
1.5.1
Removes the listener for the event triggered when a socket successfully binds to the current Wi-Fi network.
1.5.1
Sends data on the socket.
1.5.1

mDNS

Name
Feature description
Minimum version
Stops searching for mDNS services.
1.5.1
Starts searching for mDNS services on the local network.
1.5.1
Removes the listener for the mDNS service resolution failure event.
1.5.1
Listens for the mDNS service resolution failure event.
1.5.1
Removes the listener for the mDNS service lost event.
1.5.1
Listens for the mDNS service lost event.
1.5.1
Removes the listener for mDNS service found event.
1.5.1
Listens for the mDNS service found event.
1.5.1
Removes the listener for the mDNS service search stop event.
1.5.1
Listens for the mDNS service search stop event.
1.5.1

Data cache

Name
Feature description
Minimum version
Stores the data in local cache under the specified key.
1.5.0
Synchronously stores the data in local cache under the specified key.
1.5.0
Destroys data in memory based on the URL.
1.5.35
Removes the specified key from the local cache.
1.5.0
Synchronously removes the specified key from local cache.
1.5.0
Asynchronously gets the content of the specified key from the local cache.
1.5.0

Creates a unique URL in memory based on the provided buffer.
1.5.35
Synchronously gets the content of the specified key from the local cache.
1.5.0
Asynchronously gets the information of the current storage.
1.5.0
Synchronously gets the information of the current storage.
1.5.0
Clears the local data cache.
1.5.0
Synchronously clears local data cache.
1.5.0
Stores the data in batches to the specified key in the local cache.
1.5.16
Synchronously stores the data in batches to the specified key in the local cache.
1.5.16
Asynchronously gets the content of the specified key in batches from the local cache.
1.5.16
Synchronously gets the content of the specified key in batches from the local cache.
1.5.16

Data analysis

Name
Feature description
Minimum version
Reports the event.
1.5.16

Canvas

Canvas overview

Name
Feature description
Minimum version
Creates an off-screen Canvas instance.
1.5.19
Creates a drawing context (CanvasContext) for the Canvas.
1.5.0
Exports the content of the specified Canvas area to generate an image of the specified size.
1.5.0
Draws pixel data onto the Canvas.
1.5.0
Gets the pixel data of the specified area of the Canvas.
1.5.0
Image
Image object.
1.5.16
ImageData
ImageData object.
1.5.16
Canvas rendering context.
1.5.16

canvasContext

Name
Feature description
Minimum version
CanvasContext.arc
Creates an arc.
1.5.0
CanvasContext.arcTo
Creates an arc using control points and radius.
1.5.0
CanvasContext.beginPath
Starts creating a new path.
1.5.0
CanvasContext.bezierCurveTo
Creates a cubic Bezier curve path.
1.5.0
CanvasContext.clearRect
Clears the contents within the specified rectangular area on the Canvas.
1.5.0
CanvasContext.clip
Clips a region of any shape and size from the original canvas.
1.5.0
CanvasContext.closePath
Closes a path.
1.5.0
CanvasContext.createCircularGradient
Creates a circular gradient.
1.5.0
CanvasContext.createLinearGradient
Creates a linear gradient.
1.5.0
CanvasContext.createPattern
Creates a pattern using the specified image, which can be repeated in the specified direction.
1.5.0
CanvasContext.draw
Renders the previously described paths, transformations, and styles in the drawing context onto the Canvas.
1.5.0
CanvasContext.drawImage
Draws an image onto the Canvas.
1.5.0
CanvasContext.fill
Fills the content in the current path.
1.5.0
CanvasContext.fillRect
Fills a rectangle.
1.5.0
CanvasContext.fillText
Draws the filled text on the Canvas.
1.5.0
CanvasContext.lineTo
Adds a new point and creates a line from the last specified point to the target point.
1.5.0
CanvasContext.measureText
Measures the dimensions of the specified text.
1.5.0
CanvasContext.moveTo
Moves the path to the specified point on the Canvas without creating lines.
1.5.0
CanvasContext.quadraticCurveTo
Creates a quadratic Bezier curve path.
1.5.0
CanvasContext.rect
Creates a rectangular path.
1.5.0
CanvasContext.restore
Restores the previously saved drawing context.
1.5.0
CanvasContext.rotate
Rotates the current coordinate axis clockwise around the origin.
1.5.0
CanvasContext.save
Saves the drawing context.
1.5.0
CanvasContext.scale
Scales the coordinates of paths created after the call.
1.5.0
CanvasContext.setFillStyle
Sets the fill color.
1.5.0
CanvasContext.setFontSize
Sets the font size.
1.5.0
CanvasContext.setGlobalAlpha
Sets the global alpha (transparency) of the brush.
1.5.0
CanvasContext.setLineCap
Sets the line endpoint style.
1.5.0
CanvasContext.setLineDash
Sets the style of the dashed line.
1.5.0
CanvasContext.setLineJoin
Sets the style of the line joins.
1.5.0
CanvasContext.setLineWidth
Sets the line width.
1.5.0
CanvasContext.setMiterLimit
Sets the maximum miter length.
1.5.0
CanvasContext.setShadow
Sets the shadow style.
1.5.0
CanvasContext.setStrokeStyle
Sets the stroke color.
1.5.0
CanvasContext.setTextAlign
Sets the text alignment.
1.5.0
CanvasContext.setTextBaseline
Sets the vertical alignment of text.
1.5.0
CanvasContext.setTransform
Resets (overwrites) the current transformation using a matrix.
1.5.0
CanvasContext.stroke
Strokes the current path.
1.5.0
CanvasContext.strokeRect
Draws a non-filled rectangle.
1.5.0
CanvasContext.strokeText
Strokes a given text at the specified (x, y) position.
1.5.0
CanvasContext.transform
Multiplies the current transformation with the given matrix.
1.5.0
CanvasContext.translate
Translates the origin (0, 0) of the current coordinate system.
1.5.0

CanvasGradient

Name
Feature description
Minimum version
Adds a color stop to the gradient.
1.5.0

Canvas

Name
Feature description
Minimum version
Cancels an animation frame request previously scheduled with requestAnimationFrame.
1.5.16
Creates an ImageData object.
1.5.16
Creates an image object.
1.5.16
Creates a Path2D object.
1.5.16
Returns the drawing context of the Canvas.
1.5.16
Schedules a callback to be executed before the next repaint.
1.5.16
Returns a data URL containing the image display.
1.5.16

OffscreenCanvas

Name
Feature description
Minimum version
Returns the drawing context of the OffscreenCanvas.
1.5.16
Creates an image object.
1.5.16

Path2D

Name
Feature description
Minimum version
Adds a path to the current path.
1.5.16
Adds an arc to the path.
1.5.16
Adds an arc to the path with given control points.
1.5.16
Adds a cubic Bezier curve to the path.
1.5.16
Closes the path by drawing a straight line back to the start.
1.5.16
Adds an elliptical arc to the path.
1.5.16
Adds a straight line to the path.
1.5.16
Moves the path starting point.
1.5.16
Adds a quadratic Bezier curve to the path.
1.5.16
Adds a rectangle to the path.
1.5.16

Media

Map

Name
Feature description
Minimum version
Creates a MapContext object for the map.
1.5.0
Adds an arc.
1.5.16
Adds a custom layer.
1.5.16
Creates a custom image layer.
1.5.16
Adds a marker.
1.5.0
Erases or grays out lines that have been added to the map.
1.5.16
Gets the latitude and longitude corresponding to a point on the screen, with the origin at the top-left corner of the map.
1.5.0
Gets the latitude and longitude of the current map center.
1.5.0
Gets the current visible region of the map.
1.5.0
Gets the current rotation angle of the map.
1.5.0
Gets the current zoom level of the map.
1.5.0
Gets the current tilt angle of the map.
1.5.0
Zooms the view to display all latitudes and longitudes.
1.5.0
Initializes the configuration for marker clustering.
1.5.16
Moves a marker along the specified path (used for track playback and other scenarios).
1.5.0
Moves the map center to the current location point. Requires the map component's show-location to be set to true.
1.5.0
Listens for map events.
1.5.16
Opens a map app for navigation selection.
1.5.0
Deletes an arc.
1.5.16
Removes a custom layer.
1.5.16
Removes a custom image layer.
1.5.16
Removes a marker.
1.5.0
Sets the display boundary of the map.
1.5.16
Sets the offset for the map center point.
1.5.16
Sets the icon for the location marker.
1.5.16
Gets the screen coordinates corresponding to the latitude and longitude.
1.5.16
Translates a marker with animation.
1.5.0
Updates a custom image layer.
1.5.16

Image

Name
Feature description
Minimum version
Allows users to select images from the local photo album or take photos using the camera.
1.5.0
Compresses an image with optional compression quality settings.
1.5.1
Gets image information.
1.5.0
Previews an image in full screen mode on a new page.
1.5.0
Allows users to preview images and videos.
1.5.1
Saves an image to the system album.
1.5.1

Real-time audio and video

Name
Feature
Minimum version
Creates a LivePusherContext object for the live-pusher context.
1.5.0
Creates a LivePlayerContext object for the live-player context.
1.5.0
Exits the full-screen mode.
1.5.0
Mutes the audio.
1.5.0
Pauses the playback.
1.5.0
Starts the playback.
1.5.0
Enters the full-screen mode.
1.5.0
Resumes the playback.
1.5.0
Captures a screenshot.
1.5.0
Stops the playback.
1.5.0
Starts pushing the stream and enables camera preview.
1.5.0
Stops pushing the stream and disables camera preview.
1.5.0
Pauses pushing the stream.
1.5.0
Resumes pushing the stream.
1.5.0
Switches between front and rear cameras.
1.5.0
Captures a snapshot.
1.5.0
Toggles the flashlight.
1.5.0
Plays background music.
1.5.0
Stops playing background music.
1.5.0
Pauses playing background music.
1.5.0
Resumes playing background music.
1.5.0
Sets the playback position of the background music.
1.5.0
Sets the microphone volume.
1.5.0
Sets the background music volume.
1.5.0
Sets the audio reverb type.
1.5.0
Enables camera preview.
1.5.0
Disables camera preview.
1.5.0
Starts audio recording.
1.5.0
Stops recording.
1.5.0

Audio

Name
Feature description
Minimum version
stopVoice
Stops the voice playback.
1.5.1
playVoice
Starts the voice playback.
1.5.1
Pauses the voice playback.
1.5.1
Sets the playback options for InnerAudioContext.
1.5.0
Gets the currently supported audio input sources.
1.5.1
Creates the InnerAudioContext object for the internal audio component.
1.5.0
Pauses the audio playback.
1.5.1
Starts the audio playback.
1.5.1
Seeks to a specified position in the audio.
1.5.1
Sets the audio source URL.
1.5.1
InnerAudioContext.destroy
Destroys the current instance.
1.5.0
InnerAudioContext.offCanplay
Removes the event listener for when the audio can be played.
1.5.0
InnerAudioContext.offEnded
Removes the event listener for when the audio naturally ends.
1.5.0
InnerAudioContext.offError
Removes the event listener for audio playback errors.
1.5.0
InnerAudioContext.offPause
Removes the event listener for audio pause events.
1.5.0
InnerAudioContext.offPlay
Removes the event listener for audio play events.
1.5.0
InnerAudioContext.offSeeked
Removes the event listener for when the audio seek operation is completed.
1.5.0
InnerAudioContext.offSeeking
Removes the event listener for when the audio seek operation is in progress.
1.5.0
InnerAudioContext.offStop
Removes the event listener for audio stop events.
1.5.0
InnerAudioContext.offTimeUpdate
Removes the event listener for audio playback progress updates.
1.5.0
InnerAudioContext.offWaiting
Removes the event listener for audio loading events.
1.5.0
InnerAudioContext.onCanplay
Listens for the event when the audio can start playing.
1.5.0
InnerAudioContext.onEnded
Listens for the event when the audio naturally ends.
1.5.0
InnerAudioContext.onError
Listens for audio playback error event.
1.5.0
InnerAudioContext.onPause
Listens for audio pause event.
1.5.0
InnerAudioContext.onPlay
Listens for audio playback event.
1.5.0
InnerAudioContext.onSeeked
Listens for the event when audio seeking is completed.
1.5.0
InnerAudioContext.onSeeking
Listens for audio seeking event.
1.5.0
InnerAudioContext.onStop
Listens for audio stop event.
1.5.0
InnerAudioContext.onTimeUpdate
Listens for audio playback progress update event.
1.5.0
InnerAudioContext.onWaiting
Listens for audio loading event.
1.5.0
InnerAudioContext.pause
Pause the audio.
1.5.0
InnerAudioContext.play
Starts the playback.
1.5.0
InnerAudioContext.seek
Seeks to a specified position in the audio.
1.5.0
InnerAudioContext.stop
Stops the playback.
1.5.0

Video

Name
Description
Minimum version
Saves a video to the system album.
1.5.0
Creates a VideoContext object for the video component.
1.5.0
Records a video or selects a video from the phone's album.
1.5.0
Compresses a video.
1.5.1
Takes or selects images or videos from the phone's album.
1.5.1
Exits the full-screen mode.
1.5.0
Exits the background audio playback mode.
1.5.16
Exits the picture-in-picture mode. This method can be called on any page.
1.5.16
Hides the status bar, effective only in iOS full screen mode.
1.5.0
Pauses the video.
1.5.0
Plays the video.
1.5.0
Enters the full-screen mode.
1.5.0
Enters the background audio playback mode.
1.5.16
Seeks to a specified position in the audio.
1.5.0
Sends an on-screen comment.
1.5.0
Shows the status bar, effective only in iOS full screen mode.
1.5.0
Stops the video.
1.5.0

Transparent video

Name
Description
Minimum version
Creates an AnimationVideoContext object for the animation-video context.
1.5.0
Plays the video.
1.5.0
Pauses the video.
1.5.0
Seeks to a specified position in the audio.
1.5.0

Camera

Name
Feature description
Minimum version
Creates a CameraContext object for the camera component.
1.5.0
Gets real-time frame data from the camera.
1.5.0
Sets the zoom level.
1.5.0
Starts video recording.
1.5.0
Stops video recording.
1.5.0
Takes a photo.
1.5.0
Starts listening for frame data.
1.5.0
Stops listening for frame data.
1.5.0

Recording

Name
Feature
Minimum version
Starts audio recording.
1.5.1
Stops audio recording.
1.5.1
Gets the globally unique RecorderManager.
1.5.0
Listens for the recording error event.
1.5.0
Listens for the event when a specified frame size of the file has been recorded.
1.5.0
Listens for the event when recording is interrupted due to system resource occupation.
1.5.0
Listens for the event when the recording interruption ends.
1.5.0
Listens for the event when the recording pauses.
1.5.0
Listens for the event when the recording resumes.
1.5.0
Listens for the event when the recording starts.
1.5.0
Listens for the event when the recording stops.
1.5.0
Pauses the recording.
1.5.0
Resumes the recording.
1.5.0
Starts audio recording.
1.5.0
Pauses the recording.
1.5.0

Background audio

Name
Description
Minimum version
Stops playing the music.
1.5.1
Controls the playback progress of the background music.
1.5.1
Plays background music using the background player.
1.5.1
Pauses the music playback and listens for the event when music playback stops.
1.5.1
Listens for the background music stop event.
1.5.1
Listens for background music playback event.
1.5.1
Listens for background music pause event.
1.5.1
Gets the background music playback status.
1.5.1
Gets the globally unique background audio manager.
1.5.1
Listens for the event when the background audio can start playing.
1.5.16
Listens for the event when the background audio naturally ends.
1.5.16
Listens for background audio playback error event.
1.5.16
Listens for events when the user taps the next track on the system music playback panel (iOS only).
1.5.16
Listens for the background audio pause event.
1.5.16
Listens for the background audio playback event.
1.5.16
Listens for events when the user taps the previous track on the system music playback panel (iOS only).
1.5.16
Listens for the event when the background audio seek operation is completed.
1.5.16
Listens for the event when the background audio seek operation starts.
1.5.16
Listens for the background audio stop event.
1.5.16
Listens for the background audio playback progress update event.
1.5.16
Listens for audio loading event.
1.5.16
Pauses the background music.
1.5.16
Plays the background music.
1.5.16
Seeks to a specified position in the background audio.
1.5.16
Stops the background music.
1.5.16

Rich text

Name
Description
Minimum version
An EditorContext instance.
1.5.16
Blurs the editor and hides the keyboard.
1.5.16
Clears the content of the editor.
1.5.16
Modifies the format.
1.5.16
Gets the content of the editor.
1.5.16
Gets the plain text content of the selected area in the editor.
1.5.16
Inserts a divider.
1.5.16
Inserts an image.
1.5.16
Sets a segment of text, replacing the current selection.
1.5.16
Redo
1.5.16
Clears the format of the current selection.
1.5.16
Scrolls the editor cursor into the visible area of the window.
1.5.16
Initializes the content of the editor.
1.5.16
Undo
1.5.1

File

File overview

Name
Description
Minimum version
saveFile
Saves a file to the local storage.
1.5.0
Deletes local cache files.
1.5.0
Opens a document in a new page.
1.5.0
Gets the list of locally cached files saved by the mini program.
1.5.0
Gets the information of a local file.
1.5.0
Gets the globally unique file manager.
1.5.0
Gets the file information.
1.5.0
File read result.
1.5.16
File write result.
1.5.16

FileSystemManager

API
Description
Minimum version
Determines whether a file or directory exists.
1.5.0
Synchronously checks if a file/directory exists.
1.5.0
Appends content to the end of a file.
1.5.0
Synchronously appends content to the end of a file.
1.5.0
Closes a file.
1.5.16
Synchronously closes a file.
1.5.16
Copies a file.
1.5.0
Synchronously copies a file.
1.5.0
Gets status information of a file.
1.5.16
Synchronously gets status information of a file.
1.5.16
Truncates file contents.
1.5.16
Synchronously truncates file contents.
1.5.16
Gets the information of local temporary file or local cache file in this mini program.
1.5.0
Gets the list of locally cached files saved by the mini program.
1.5.0
Creates a directory.
1.5.0
Synchronously creates a directory.
1.5.0
Opens a file and returns a file descriptor.
1.5.16
Synchronously opens a file and returns a file descriptor.
1.5.16
Reads a file.
1.5.16
Synchronously reads a file.
1.5.16
Reads the content of a local file with a specified compression type.
1.5.16
Synchronously reads the content of a local file with a specified compression type.
1.5.16
Reads the list of files in the directory.
1.5.0
Synchronously reads the list of files in the directory.
1.5.0
Reads local file contents.
1.5.0
Synchronously reads local file contents.
1.5.0
Reads files in a compressed package.
1.5.16
Deletes saved local cache files in this mini program.
1.5.0
Renames a file.
1.5.0
Synchronously renames a file.
1.5.0
Deletes a directory.
1.5.0
Synchronously deletes a directory.
1.5.0
Saves a temporary file to a local storage.
1.5.0
Synchronously saves a temporary file to a local storage.
1.5.0
Gets a file Stats object.
1.5.0
Synchronously gets a file Stats object.
1.5.0
Truncates file contents.
1.5.16
Synchronously truncates file contents.
1.5.16
Deletes a file.
1.5.0
Synchronously deletes a file.
1.5.0
Decompresses a file.
1.5.0
Writes to a file.
1.5.16
Synchronously writes to a file.
1.5.16
Writes a file.
1.5.0
Synchronously writes a file.
1.5.0

Stats

API
Description
Minimum version
Checks whether the current file is a directory.
1.5.0
Checks whether the current file is a normal file.
1.5.0

Open APIs

Login

Name
Feature description
Minimum version
login
Calls the API to get the login credential (code).
1.5.1
Checks if the login session has expired.
1.5.1

Account information

Name
Feature description
Minimum version
Gets the current account information.
1.5.1

User information

Name
Feature description
Minimum version
Gets user information.
1.5.1
Gets user information, requires user authorization for scope.userInfo.
1.5.1
userInfo
User information.
1.5.0

Settings

Name
Feature description
Minimum version
User’s authorization settings information.
1.5.0
Gets the user's current settings.
1.5.0
Opens the mini program settings interface and returns the user's operation results.
1.5.0

Biometric authentication

Name
Feature description
Minimum version
Checks whether biometric information is entered into the device.
1.5.0
Verifies if the device supports biometric authentication.
1.5.0
Starts the biometric authentication.
1.5.0

Authorization

Name
Feature description
Minimum version
authorize
Initiates an authorization request to the user in advance.
1.5.0

Location

Name
Feature description
Minimum version
Gets the current geographic location and speed.
1.5.0
choosePoi
Opens the POI list to select the location. Supports both fuzzy (city-level) and precise location selection.
1.5.0
Opens the map and selects a location.
1.5.0
Stops listening for real-time geographic location changes, halting message reception in both foreground and background.
1.5.0
Enables receiving location messages when the mini program enters both foreground and background, requires user authorization.
1.5.0
Enables receiving location messages when the mini program enters the frontend.
1.5.0
Uses the built-in map to view the location.
1.5.0
Listens for the event triggered when the continuous location API returns a failure.
1.5.0
Listens for real-time geographic location change events, used in conjunction with startLocationUpdateBackground and startLocationUpdate.
1.5.0
Removes the listener for failures returned by the continuous location API.
1.5.0
Removes the listener for real-time geographic location change events.
1.5.0
Gets the current fuzzy geographic location.
1.5.0

Device

General-purpose Bluetooth API

Name
Feature description
Minimum version
Stops searching for nearby Bluetooth peripheral devices.
1.5.0
Starts searching for nearby Bluetooth peripheral devices.
1.5.0
Initializes the Bluetooth module.
1.5.1
Gets connected Bluetooth devices based on the main service UUID.
1.5.1
Gets all Bluetooth devices discovered during the active period of the Bluetooth module.
1.5.1
Gets the state of the Bluetooth adapter.
1.5.1
Closes the Bluetooth module.
1.5.1
Listens for the event when a new device is discovered.
1.5.0
Removes all listeners for the event when a new device is discovered.
1.5.0
Listens for the event when the Bluetooth adapter state changes.
1.5.0
Removes all listeners for the event when the Bluetooth adapter state changes.
1.5.0
The Bluetooth pairing API, which is supported only on Android.
1.5.0
Checks if a Bluetooth device is paired, supported only on Android.
1.5.0

Bluetooth Low Energy (BLE) central device

Name
Feature description
Minimum version
Writes binary data to the characteristic value of a Bluetooth Low Energy (BLE) device.
1.5.1
Reads binary data from the characteristic value of a Bluetooth Low Energy (BLE) device.
1.5.1
setBLEMTU
Negotiates and sets the Maximum Transmission Unit (MTU) for Bluetooth Low Energy.
1.5.1
getBLEMTU
Gets the Maximum Transmission Unit (MTU) for Bluetooth Low Energy.
1.5.1
Listens for the event when the Maximum Transmission Unit (MTU) for Bluetooth Low Energy changes (triggered only on Android).
1.5.1
Removes the listener for the Maximum Transmission Unit (MTU) change event.
1.5.1
Listens for the event when the connection status of a Bluetooth Low Energy device changes.
1.5.1
Removes the listener for changes in the connection state of Bluetooth Low Energy devices.
1.5.1
Listens for changes in the characteristic values of Bluetooth Low Energy devices.
1.5.1
Remove all listeners for changes in the characteristic values of Bluetooth Low Energy devices.
1.5.1
Enables the notify feature for characteristic value changes in Bluetooth Low Energy devices, subscribing to the characteristic.
1.5.1
Gets all services of a Bluetooth Low Energy device.
1.5.1
Gets the signal strength of a Bluetooth Low Energy device.
1.5.1
Gets all characteristics of a specific service in a Bluetooth Low Energy device.
1.5.1
Connects to a Bluetooth Low Energy device.
1.5.1
Disconnects from a Bluetooth Low Energy device.
1.5.1

Bluetooth Low Energy (BLE) peripheral device

Name
Feature description
Minimum version
Listens for events when the current peripheral device is connected or disconnected.
1.5.1
Removes the listener for events when the current peripheral device is connected or disconnected.
1.5.1
Establishes a local server as a Bluetooth Low Energy (BLE) peripheral server.
1.5.1
Adds a service.
1.5.1
Removes a service.
1.5.1
Starts advertising the locally created peripheral device.
1.5.1
Stops advertising the locally created peripheral device.
1.5.1
Writes a binary data value to the specified characteristic and notifies the connected host.
1.5.1
Listens for the event when a connected device requests to write the characteristic value of the current peripheral device.
1.5.1
Removes the listener for the event when a connected device requests to write the characteristic value of the current peripheral device.
1.5.1
Listens for the event when a connected device requests to read the characteristic value of the current peripheral device.
1.5.1
Removes the listener for the event when a connected device requests to read the characteristic value of the current peripheral device.
1.5.1
Listens for the characteristic subscription event (supported only on iOS).
1.5.1
Removes the listener for the characteristic subscription event (supported only on iOS).
1.5.1
Listens for the characteristic unsubscription event (supported only on iOS).
1.5.1
Removes the listener for the characteristic unsubscription event (supported only on iOS).
1.5.1

Bluetooth - Beacon

Name
Feature description
Minimum version
Stops searching for nearby Beacon devices.
1.5.1
Starts searching for nearby Beacon devices.
1.5.1
Listens for the Beacon device update event (only one listener can be registered).
1.5.1
Remove all listeners for the Beacon device update event.
1.5.1
Listens for the Beacon service status change event (only one listener can be registered).
1.5.1
Removes all listeners for the Beacon service status change event.
1.5.1
Gets all discovered Beacon devices.
1.5.1
Beacon device information.
1.5.1

NFC

getNFCAdapter

Name
Feature description
Minimum version
Gets the NFC instance.
1.5.0

NFCAdapter

Name
Feature description
Minimum version
Starts the device.
1.5.0
Stops the device.
1.5.0
Gets the Ndef instance, which supports reading and writing NDEF data on NFC tags in NDEF format.
1.5.0
Gets the NfcA instance, which supports reading and writing according to the NFC-A (ISO 14443-3A) standard.
1.5.0
Gets the NfcB instance, which supports reading and writing according to the NFC-B (ISO 14443-3B) standard.
1.5.0
Gets the NfcF instance, which supports reading and writing according to the NFC-F (JIS 6319-4) standard.
1.5.0
Gets the NfcV instance, which supports reading and writing according to NFC-V (ISO 15693) standard.
1.5.0
Gets the IsoDep instance, which supports reading and writing according to ISO-DEP (ISO 14443-4) standard.
1.5.0
Gets the MifareClassic instance, which supports reading and writing MIFARE Classic tags.
1.5.0
Gets the MifareUltralight instance, which supports reading and writing MIFARE Ultralight tags.
1.5.0
Listens for the NFC tag discovery event.
1.5.0
Removes the listener for the NFC tag discovery event.
1.5.0

IsoDep

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0
Gets the historical bytes.
1.5.0

MifareClassic

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0

MifareUltralight

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0

Ndef

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Removes the listener for Ndef messages.
1.5.0
Listens for Ndef messages.
1.5.0
Rewrites the content of an Ndef tag.
1.5.0

NfcA

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0
Gets ATQA information.
1.5.0
Gets SAK information.
1.5.0

NfcB

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0

NfcF

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0

NfcV

Name
Feature description
Minimum version
Connects to the NFC tag.
1.5.0
Disconnects from the NFC tag.
1.5.0
Sets the timeout duration.
1.5.0
Checks if the NFC tag is connected.
1.5.0
Gets the maximum transceive length.
1.5.0
Sends data.
1.5.0

Wi-Fi

Name
Feature description
Minimum version
Listens for the event when Wi-Fi is connected.
1.5.1
Removes the listener for the event when Wi-Fi is connected.
1.5.1
stopWifi
Turns off the Wi-Fi module.
1.5.0
startWifi
Initializes the Wi-Fi module.
1.5.0
Listens for the event when Wi-Fi list data is obtained.
1.5.0
Removes the listener for the event when Wi-Fi list data is obtained.
1.5.0
Gets information about the connected Wi-Fi.
1.5.0
WifiInfo
Wi-Fi information.
1.5.1

Calendar

Name
Feature description
Minimum version
Adds a recurring event to the system calendar.
1.5.1
Adds an event to the system calendar.
1.5.1

Clipboard

Name
Feature description
Minimum version
Sets the content of the system clipboard.
1.5.1
Gets the content of the system clipboard.
1.5.1

Network‍

Name
Feature description
Minimum version
Listens for network status change event.
1.5.1
Gets the network type.
1.5.1
Removes the listener for network status change event.
1.5.1

Encryption

Name
Feature description
Minimum version
Gets cryptographically secure pseudo-random values.
1.5.1

Keyboard

Name
Feature description
Minimum version
Listens for keyboard height change event.
1.5.1
Manually hides the keyboard after it is raised by focusing on input or textarea elements.
1.5.1
Removes the listener for keyboard height change event.
1.5.1
Gets the cursor position within the input field after focusing on elements like input or textarea.
1.5.1

Phone

Name

Feature description
Minimum version

Makes a phone call.
1.5.1

Accelerometer

Name
Feature description
Minimum version
Starts listening for accelerometer data.
1.5.1
Stops listening for acceleration data.
1.5.1
Listens for accelerometer data change event.
1.5.1
Removes the listener for accelerometer data changes event.
1.5.1

Compass

Name
Feature description
Minimum version
Starts listening for compass data.
1.5.0
Stops listening for compass data event.
1.5.0
Listens for compass data change event.
1.5.0
Removes the listener for compass data change event.
1.5.0

Gyroscope

Name
Feature description
Minimum version
Starts listening for gyroscope data.
1.5.1
Stops listening for gyroscope data.
1.5.1
Listens for gyroscope data change event.
1.5.1
Removes the listener for gyroscope data change event.
1.5.1

Scan code

Name
Feature description
Minimum version
scanCode
Opens the client’s QR code scanning interface to scan the QR code.
1.5.0

SMS

Name
Feature description
Minimum version
sendSms
Opens the phone's SMS sending interface.
1.5.1

Vibration

Name
Feature description
Minimum version
Causes the phone to vibrate for a short duration (15 ms).
1.5.1
Causes the phone to vibrate for a long duration (400 ms).
1.5.1

Contacts

Name
Feature description
Minimum version
Opens the phone's contact list to select a contact.
1.5.1
Adds a contact to the phone's contact list.
1.5.1

Battery

Name
Feature description
Minimum version
Synchronously gets battery information of the device.
1.5.1
Gets the device's battery information.
1.5.1

Screen

Name
Feature description
Minimum version
Sets the screen's visual effect during screenshot/recording.
1.5.1
Sets the screen brightness.
1.5.1
Sets whether to keep the screen on.
1.5.1
Listens for user-initiated screenshot event.
1.5.1
Listens for user-initiated screen recording event.
1.5.1
User-initiated screenshot event.
1.5.1
Removes the listener for user-initiated screen recording event.
1.5.1
Checks if the user is recording the screen.
1.5.1
Gets the screen brightness.
1.5.1

Device motion

Name
Feature description
Minimum version
Stops listening for device motion change event.
1.5.1
Starts listening for device motion change event.
1.5.1
Listens for device motion change event.
1.5.1
Removes the listener for device motion change event.
1.5.1

Memory

Name
Feature description
Minimum version
Listens for the low memory alert event.
1.5.1
Removes the listener for the low memory alert event.
1.5.1

Accessibility

Name
Feature description
Minimum version
Checks whether the visual accessibility feature is enabled.
1.5.1

WXML

WXML overview

Name
Feature description
Minimum version
Returns a SelectorQuery object instance.
1.5.0
Creates and returns an IntersectionObserver object instance.
1.5.0

IntersectionObserve

Name
Feature description
Minimum version
Uses a selector to specify a node as one of the reference areas.
1.5.0
Specifies the viewport as one of the reference areas.
1.5.0
Stops listening, and the callback function will no longer be triggered.
1.5.0
Specifies the target node and starts listening for intersection status changes.
1.5.0

NodesRef

Name
Feature description
Minimum version
Gets relevant information about the node.
1.5.0
Adds a query request for the node's layout position.
1.5.0
Adds a query request for the node's scroll position.
1.5.0
Adds a query request for the node's Context object.
1.5.0
Gets the Node instance.
1.5.0

SelectorQuery

Name
Feature description
Minimum version
Executes all requests.
1.5.0
Changes the selection scope of the selector to within a custom component.
1.5.0
Selects the first node that matches the selector within the current page.
1.5.0
Selects all nodes that match the selector within the current page.
1.5.0
Selects the viewport.
1.5.0

meidaQueryObserver

Name
Feature description
Minimum version
Stops listening.
1.5.16
Starts listening for media query changes.
1.5.16

Custom APIs

Name
Feature description
Minimum version
Custom APIs.
1.5.0

Ad

Name
Feature description
Minimum version
Rewarded ad.
2.2.3


Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

7x24 Phone Support
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon