API Overview
Basic
System
Update
| Name | Function Description | Version | Remarks |
| ft.getUpdateManager | Get a globally unique update manager for managing Mini-Game updates | 1.0.0 | |
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.updateWeChatApp | Update client version |
Mini-Game
Lifecycle
| Name | Function Description | Version | Remarks |
| ft.onShow | Listen for the event when the Mini-Game returns to the foreground | 1.0.0 | |
| ft.onHide | Listen for the event when the Mini-Game is hidden to the background | 1.0.0 | |
| ft.offShow | Cancel listening for the event when the Mini-Game returns to the foreground | 1.0.0 | |
| ft.offHide | Cancel listening for the event when the Mini-Game is hidden to the background | 1.0.0 | |
| ft.getLaunchOptionsSync | Get the parameters when the Mini-Game starts | 1.0.0 | |
| ft.getEnterOptionsSync | Get the parameters for this Mini-Game launch | 1.0.0 | |
App-Level Events
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.onUnhandledRejection | Listen for unhandled Promise rejection events |
| ft.offUnhandledRejection | Cancel listening for unhandled Promise rejection events |
Debugging
| Name | Function Description | Version | Remarks |
| ft.setEnableDebug | Set whether to turn on the debug switch | 1.0.0 | |
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.getRealtimeLogManager | Get real-time log manager object |
| ft.getLogManager | Get log manager object |
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.reportPerformance | Mini-Game speed measurement reporting |
| ft.getPerformance | Get performance-related information for the current Mini-Game |
Encryption
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.getUserCryptoManager | Get user encryption module |
Navigation
Sharing
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.showShareImageMenu | Open the share image popup, allowing images to be sent to friends, favorited, or downloaded |
| ft.shareVideoMessage | Share video to chat |
| ft.shareFileMessage | Share file to chat |
| ft.onCopyUrl | Listen for the event triggered when the user clicks the "Copy Link" button in the top-right menu |
| ft.offCopyUrl | Cancel listening for the event triggered when the user clicks the "Copy Link" button in the top-right menu |
| ft.getShareInfo | Get detailed sharing information |
| ft.authPrivateMessage | Verify private message |
Interface
Interaction
Navigation Bar
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.hideHomeButton | Hide the home button |
Window
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.setWindowSize | Set window size; this interface is only applicable to PC platforms; see the guide for usage details |
| ft.onWindowResize | Listen for window size change events |
| ft.offWindowResize | Cancel listening for window size change events |
Network
Initiate Request
| Name | Function Description | Version | Remarks |
| ft.request | Initiate HTTPS network request | 1.0.0 | |
Download
| Name | Function Description | Version | Remarks |
| ft.downloadFile | Download file resources to local storage | 1.0.0 | |
Upload
| Name | Function Description | Version | Remarks |
| ft.uploadFile | Upload local resources to the server | 1.0.0 | |
WebSocket
UDP Communication
| Name | Function Description | Version | Remarks |
| ft.createUDPSocket | Create a UDP Socket instance | 1.0.0 | |
Payment
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.requestMidasPayment | Initiate MiDaSi payment |
| ft.requestMidasFriendPayment | Initiate MiDaSi friend gift request |
Data Storage
Note
The following APIs are not currently supported
| Name | Function Description | Version | Remarks |
| ft.revokeBufferURL | Destroy data in memory based on URL | 1.0.0 | |
| ft.createBufferURL | Create a unique URL in memory based on the passed buffer | 1.0.0 | |
Data Analytics
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.reportMonitor | Custom business data monitoring reporting interface |
| ft.reportEvent | Event reporting |
| ft.reportAnalytics | Custom analytics data reporting interface |
| ft.getExptInfoSync | Given an array of experiment parameters, get the corresponding experiment parameter values |
Rendering
Canvas
| Name | Function Description | Version | Remarks |
| ft.createCanvas | Create a canvas object | 1.0.0 | |
Canvas
| Name | Function Description | Version | Remarks |
| Canvas.getContext | Get the drawing context of the canvas object | 1.0.0 | |
| Canvas.toDataURL | Return a data URI containing the image representation | 3.0.0 | |
Note
The following APIs are not currently supported
| Name | Function Description |
| Canvas.toTempFilePath | Save the current Canvas as a temporary file |
| Canvas.toTempFilePathSync | Synchronous version of Canvas.toTempFilePath |
| WebGLRenderingContext.wxBindCanvasTexture | Bind a Texture corresponding to a Canvas to the WebGL context |
Images
| Name | Function Description | Version | Remarks |
| ft.createImage | Create an image object | 1.0.0 | |
| Image | Image object | 1.0.0 | |
Fonts
Audio
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.getAvailableAudioSources | Get the currently supported audio input sources |
| ft.createWebAudioContext | Create a WebAudio context |
| ft.createMediaAudioPlayer | Create a MediaAudioPlayer object, which can be used to play audio output from VideoDecoder |
Images
Recording
| Name | Function Description | Version | Remarks |
| ft.getRecorderManager | Get the globally unique RecorderManager | 1.0.0 | |
Video
| Name | Function Description | Version | Remarks |
| ft.createVideoContext | Create a VideoContext object for video | 1.0.0 | |
Camera
| Name | Function Description | Version | Remarks |
| ft.createCameraContext | Create a CameraContext object for camera | 1.0.0 | |
Video Decoder
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.createVideoDecoder | Create a video decoder to obtain frame-by-frame decoded data |
Real-Time Voice
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.updateVoIPChatMuteConfig | Update real-time voice mute settings |
| ft.subscribeVoIPVideoMembers | Subscribe to video member streams |
| ft.onVoIPVideoMembersChanged | Listen for changes in the video status of real-time voice call members |
| ft.onVoIPChatStateChanged | Listen for room state change events |
| ft.onVoIPChatSpeakersChanged | Listen for changes in the call status of real-time voice call members |
| ft.onVoIPChatMembersChanged | Listen for changes in the online status of real-time voice call members |
| ft.onVoIPChatInterrupted | Listen for passive disconnection events of real-time voice calls |
| ft.offVoIPVideoMembersChanged | Stop listening for changes in the video status of real-time voice call members |
| ft.offVoIPChatStateChanged | Stop listening for room state change events |
| ft.offVoIPChatMembersChanged | Stop listening for changes in the online status of real-time voice call members |
| ft.offVoIPChatInterrupted | Stop listening for passive disconnection events of real-time voice calls |
| ft.joinVoIPChat | Join (create) a real-time voice call; for more information, see the Real-Time Voice Guide |
| ft.exitVoIPChat | Exit (destroy) a real-time voice call |
Location
| Name | Function Description | Version | Remarks |
| ft.getLocation | Get the current geographical location and speed | 1.0.0 | |
Files
FileSystemManager
Open Interfaces
Please note
The following APIs are not currently supported. You can click here to learn how to reuse WeChat login capabilities in Mini-Programs.
| Name | Function Description |
| ft.getUserProfile | Get user information |
| ft.getUserInfo | Get user information |
| UserInfo | User information |
Login
Please note
The following APIs are not currently supported. You can click here to learn how to reuse WeChat login capabilities in Mini-Programs.
| Name | Function Description |
| ft.login | Call the interface to obtain a login credential (code) |
| ft.checkSession | Check whether the login session has expired |
Authorization
| Name | Function Description |
| ft.authorize | Request authorization from the user in advance |
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.authorizeForMiniProgram | This interface can only be called in Mini-Game plugins, with usage similar to ft.authorize |
| Name | Function Description |
| ft.getAccountInfoSync | Get current account information |
Settings
| Name | Function Description | Version | Remarks |
| ft.openSetting | Open the Mini-Program settings interface on the client side and return the user's operation results | 1.0.0 | |
| ft.getSetting | Get the user's current settings | 1.0.0 | |
| AuthSetting | User authorization settings information; refer to permissions for details | 1.0.0 | |
Shipping Address
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.chooseAddress | Get the user's shipping address |
Cards
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.openCard | View cards in the WeChat card wallet |
| ft.addCard | Add multiple cards in bulk |
Invoices
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.chooseInvoiceTitle | Select the user's invoice title |
| ft.chooseInvoice | Select an invoice that the user already has |
Biometric Authentication
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.startSoterAuthentication | Start SOTER biometric authentication |
| ft.checkIsSupportSoterAuthentication | Get the SOTER biometric authentication methods supported by this device |
| ft.checkIsSoterEnrolledInDevice | Check if biometric information such as fingerprints has been registered on the device |
Fitness
Please note
The following APIs are not currently supported
| Name | Function Description |
| ft.shareToWeRun | Share data to WeRun |
| ft.getWeRunData | Get the user's step count for the past 30 days |
Subscription Messages
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.requestSubscribeMessage | Invoke the mini-game subscription message interface on the client side and return the result of the user's subscription operation |
WeChat Red Envelopes
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.showRedPackage | Pull up the H5 red envelope cover page |
Favorites
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.addVideoToFavorites | Favorite a video |
| ft.addFileToFavorites | Favorite a file |
License Plates
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.chooseLicensePlate | Select a license plate number |
Channels (Video Accounts)
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.reserveChannelsLive | Reserve a live stream for a Channel |
| ft.openChannelsLive | Open a live stream for a Channel |
| ft.openChannelsActivity | Open a video from a Channel |
| ft.getChannelsLiveNoticeInfo | Get the live stream announcement information for a Channel |
| ft.getChannelsLiveInfo | Get the live stream information for a Channel |
WeChat Groups
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.getGroupEnterInfo | Get the mini-game launch information in the context of a WeChat group chat |
WeChat Customer Service
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.openCustomerServiceChat | Open WeChat customer service |
Device
Bluetooth - General
| Name | Function Description |
| ft.stopBluetoothDevicesDiscovery | Stop searching for nearby Bluetooth peripheral devices |
| ft.startBluetoothDevicesDiscovery | Start searching for nearby Bluetooth peripheral devices |
| ft.openBluetoothAdapter | Initialize the Bluetooth module |
| ft.onBluetoothDeviceFound | Listen for events when new devices are discovered |
| ft.onBluetoothAdapterStateChange | Listen for changes in the Bluetooth adapter state |
| ft.offBluetoothDeviceFound | Cancel listening for newly discovered devices |
| ft.offBluetoothAdapterStateChange | Cancel listening for changes in the Bluetooth adapter state |
| ft.makeBluetoothPair | Bluetooth pairing interface, Android only |
| ft.getConnectedBluetoothDevices | Get connected Bluetooth devices based on the primary service UUID |
| ft.getBluetoothDevices | Get all Bluetooth devices discovered during the active period of the Bluetooth module |
| ft.getBluetoothAdapterState | Get the status of the local Bluetooth adapter |
| ft.closeBluetoothAdapter | Close the Bluetooth module |
Bluetooth - Low Energy Central Device
| Name | Function Description |
| ft.writeBLECharacteristicValue | Write binary data to the characteristic value of a BLE device |
| ft.setBLEMTU | Negotiate and set the Maximum Transmission Unit (MTU) for BLE |
| ft.readBLECharacteristicValue | Read binary data from the characteristic value of a BLE device |
| ft.onBLEConnectionStateChange | Listen for changes in the BLE connection state |
| ft.onBLECharacteristicValueChange | Listen for changes in the characteristic value of a BLE device |
| ft.offBLEConnectionStateChange | Cancel listening for changes in the BLE connection state |
| ft.offBLECharacteristicValueChange | Cancel listening for changes in the characteristic value of a BLE device |
| ft.notifyBLECharacteristicValueChange | Enable notify functionality for characteristic value changes in BLE devices, subscribing to characteristics |
| ft.getBLEDeviceServices | Get all services of a BLE device |
| ft.getBLEDeviceRSSI | Get the Received Signal Strength Indication (RSSI) of a BLE device |
| ft.getBLEDeviceCharacteristics | Get all characteristics of a specific service of a BLE device |
| ft.createBLEConnection | Connect to a BLE device |
| ft.closeBLEConnection | Disconnect from a BLE device |
Bluetooth - Low Energy Peripheral Device
| Name | Function Description |
| ft.onBLEPeripheralConnectionStateChanged | Listen for connection or disconnection events of the current peripheral device |
| ft.offBLEPeripheralConnectionStateChanged | Cancel listening for connection or disconnection events of the current peripheral device |
| ft.createBLEPeripheralServer | Establish a local server as a BLE peripheral device, multiple servers can be created |
Bluetooth - Beacon (Beacon)
| Name | Function Description |
| ft.stopBeaconDiscovery | Stop searching for nearby Beacon devices |
| ft.startBeaconDiscovery | Start searching for nearby Beacon devices |
| ft.onBeaconUpdate | Listen for Beacon device update events, only one listener can be registered |
| ft.onBeaconServiceChange | Listen for Beacon service status change events, only one listener can be registered |
| ft.offBeaconUpdate | Cancel listening for Beacon device update events |
| ft.offBeaconServiceChange | Cancel listening for Beacon service status change events |
| ft.getBeacons | Get all discovered Beacon devices |
| BeaconInfo | |
Accessibility
Note
The following API is not currently supported
Battery
Clipboard
Network
Screen
Keyboard
Accelerometer
Compass
| Name | Function Description | Version | Remarks |
| ft.stopCompass | Stop listening for compass data | 1.0.0 | |
| ft.startCompass | Start listening for compass data | 1.0.0 | |
| ft.onCompassChange | Listen for compass data change events | 1.0.0 | |
| ft.offCompassChange | Cancel listening for compass data change events; if the parameter is empty, cancel all event listeners | 1.0.0 | |
Device Orientation
Screen Rotation
Gyroscope
Memory
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.onMemoryWarning | Listen for memory warning events |
| ft.offMemoryWarning | Cancel listening for memory warning events |
QR Code Scanning
| Name | Function Description | Version | Remarks |
| ft.scanCode | Invoke the client-side QR code scanning interface to scan codes | 1.0.0 | |
Vibration
| Name | Function Description | Version | Remarks |
| ft.vibrateShort | Make the phone vibrate for a short duration (15 ms) | 1.0.0 | |
| ft.vibrateLong | Make the phone vibrate for a longer duration (400 ms) | 1.0.0 | |
AI/Facial Recognition
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.stopFaceDetect | Stop facial recognition |
| ft.initFaceDetect | Initialize facial recognition |
| ft.faceDetect | Perform facial recognition; initialization via ft.initFaceDetect is required before use; it is recommended to use frame data returned by the camera interface |
Worker
Note
The following APIs are not currently supported
| Name | Function Description |
| ft.createWorker | Create a Worker thread |
Other