# Limitation on Calling APIs via Plug-Ins
APIs that can be called via plug-ins differ from Mini Programs in mainly two aspects:
- The requested domain name list of plug-ins is independent of that of Mini Programs.
- Some APIs cannot be called by plug-ins (Such API functions are not under the
wx
object).
Some APIs are unavailable in plug-ins, but can be called on feature pages of plug-ins. For more information, refer to Feature Pages of Plug-Ins.
APIs that can be called by plug-ins and their required versions are as follows:
# Initiating a Request
API | Minimum Version | Remarks |
---|---|---|
wx.request | 1.9.6 |
# Upload and Download
API | Minimum Version | Remarks |
---|---|---|
wx.downloadFile | 1.9.6 | |
wx.uploadFile | 1.9.6 |
# WebSocket
API | Minimum Version | Remarks |
---|---|---|
wx.connectSocket | 1.9.6 |
# Image
API | Minimum Version | Remarks |
---|---|---|
wx.previewImage | 1.9.6 | |
wx.chooseImage | 1.9.6 | |
wx.getImageInfo | 1.9.6 | |
wx.saveImageToPhotosAlbum | 1.9.6 |
# Recording
API | Minimum Version | Remarks |
---|---|---|
wx.startRecord | 1.9.6 | |
wx.stopRecord | 1.9.6 |
# Real-Time Audio and Video
API | Minimum Version | Remarks |
---|---|---|
wx.createLivePlayerContext | 1.9.6 | |
wx.createLivePusherContext | 1.9.6 |
# Recording Management
API | Minimum Version | Remarks |
---|---|---|
wx.getRecorderManager | 1.9.94 |
# Audio Playback Control
API | Minimum Version | Remarks |
---|---|---|
wx.pauseVoice | 1.9.6 | |
wx.playVoice | 1.9.6 | |
wx.stopVoice | 1.9.6 |
# Music Playback Control
# Background Audio Playback Management
API | Minimum Version | Remarks |
---|---|---|
wx.getBackgroundAudioManager | 1.9.6 |
# Audio Component Control
API | Minimum Version | Remarks |
---|---|---|
wx.createInnerAudioContext | 1.9.6 | |
wx.createAudioContext | 1.9.6 |
# Video
API | Minimum Version | Remarks |
---|---|---|
wx.chooseVideo | 1.9.6 | |
wx.saveVideoToPhotosAlbum | 1.9.6 |
# Video Component Control
API | Minimum Version | Remarks |
---|---|---|
wx.createVideoContext | 1.9.6 |
# Camera Component Control
API | Minimum Version | Remarks |
---|---|---|
wx.createCameraContext | 1.9.6 |
# Data Caching
API | Minimum Version | Remarks |
---|---|---|
wx.setStorageSync | 1.9.6 | |
wx.getStorage | 1.9.6 | |
wx.removeStorageSync | 1.9.6 | |
wx.setStorage | 1.9.6 | |
wx.getStorageSync | 1.9.6 | |
wx.removeStorage | 1.9.6 |
# Obtaining a Location
API | Minimum Version | Remarks |
---|---|---|
wx.getLocation | 1.9.6 | |
wx.chooseLocation | 1.9.6 |
# Viewing a Location
API | Minimum Version | Remarks |
---|---|---|
wx.openLocation | 1.9.6 |
# Map Component Control
API | Minimum Version | Remarks |
---|---|---|
wx.createMapContext | 1.9.6 |
# System Information
API | Minimum Version | Remarks |
---|---|---|
wx.getSystemInfoSync | 1.9.6 | |
wx.getSystemInfo | 1.9.6 |
# Screen Brightness
API | Minimum Version | Remarks |
---|---|---|
wx.setKeepScreenOn | 1.9.6 | |
wx.setScreenBrightness | 1.9.6 | |
wx.getScreenBrightness | 1.9.6 |
# User Screenshot Event
API | Minimum Version | Remarks |
---|---|---|
wx.onUserCaptureScreen | 1.9.6 | Called only on plug-in pages |
# Vibration
API | Minimum Version | Remarks |
---|---|---|
wx.vibrateLong | 1.9.6 | |
wx.vibrateShort | 1.9.6 |
# Mobile Contacts
API | Minimum Version | Remarks |
---|---|---|
wx.addPhoneContact | 1.9.6 |
# NFC
API | Minimum Version | Remarks |
---|---|---|
wx.sendHCEMessage | 2.1.0 | |
wx.stopHCE | 2.1.0 | |
wx.onHCEMessage | 2.1.0 | |
wx.startHCE | 2.1.0 | |
wx.getHCEState | 2.1.0 |
# Network Status
API | Minimum Version | Remarks |
---|---|---|
wx.onNetworkStatusChange | 1.9.6 | |
wx.getNetworkType | 1.9.6 |
# Accelerometer
API | Minimum Version | Remarks |
---|---|---|
wx.startAccelerometer | 1.9.6 | |
wx.stopAccelerometer | 1.9.6 | |
wx.onAccelerometerChange | 1.9.6 |
# Compass
API | Minimum Version | Remarks |
---|---|---|
wx.onCompassChange | 1.9.6 | |
wx.stopCompass | 1.9.6 | |
wx.startCompass | 1.9.6 |
# Making a Call
API | Minimum Version | Remarks |
---|---|---|
wx.makePhoneCall | 1.9.6 |
# Scanning a QR Code
API | Minimum Version | Remarks |
---|---|---|
wx.scanCode | 1.9.6 |
# Clipboard
API | Minimum Version | Remarks |
---|---|---|
wx.setClipboardData | 1.9.6 | |
wx.getClipboardData | 1.9.6 |
# Bluetooth
# iBeacon
API | Minimum Version | Remarks |
---|---|---|
wx.getBeacons | 1.9.6 | |
wx.startBeaconDiscovery | 1.9.6 | |
wx.onBeaconServiceChange | 1.9.6 | |
wx.onBeaconUpdate | 1.9.6 | |
wx.stopBeaconDiscovery | 1.9.6 |
# Interactive Feedback
API | Minimum Version | Remarks |
---|---|---|
wx.hideLoading | 1.9.6 | |
wx.showActionSheet | 1.9.6 | |
wx.showLoading | 1.9.6 | |
wx.hideToast | 1.9.6 | |
wx.showToast | 1.9.6 | |
wx.showModal | 1.9.6 |
# Setting the Navigation Bar
API | Minimum Version | Remarks |
---|---|---|
wx.showNavigationBarLoading | 2.1.0 | Called only on plug-in pages |
wx.hideNavigationBarLoading | 2.1.0 | Called only on plug-in pages |
wx.setNavigationBarColor | 2.1.0 | Called only on plug-in pages |
wx.setNavigationBarTitle | 2.1.0 | Called only on plug-in pages |
# Background
API | Minimum Version | Remarks |
---|---|---|
wx.setBackgroundColor | 2.4.0 | Called only on plug-in pages |
wx.setBackgroundTextStyle | 2.4.0 | Called only on plug-in pages |
# WXML Node Information
API | Minimum Version | Remarks |
---|---|---|
wx.createSelectorQuery | 1.9.6 |
# WXML Node Layout Intersection
API | Minimum Version | Remarks |
---|---|---|
wx.createIntersectionObserver | 1.9.6 |
# Navigator
API | Minimum Version | Remarks |
---|---|---|
wx.navigateBack | 2.1.0 | Called only on plug-in pages |
wx.navigateTo | 2.2.2 | Called only on plug-in pages |
wx.redirectTo | 2.2.2 | Called only on plug-in pages |
wx.switchTab | 2.3.1 | Called only on plug-in pages |
wx.reLaunch | 2.3.1 | Called only on plug-in pages |
# Animation
API | Minimum Version | Remarks |
---|---|---|
wx.createAnimation | 1.9.6 |
# Location
API | Minimum Version | Remarks |
---|---|---|
wx.pageScrollTo | 2.1.0 | Called only on plug-in pages |
# Drawing
API | Minimum Version | Remarks |
---|---|---|
wx.canvasPutImageData | 1.9.6 | |
wx.canvasToTempFilePath | 1.9.6 | |
wx.createCanvasContext | 1.9.6 | |
wx.canvasGetImageData | 1.9.6 |
# Pulling Down to Refresh
API | Minimum Version | Remarks |
---|---|---|
wx.stopPullDownRefresh | 2.1.0 | Called only on plug-in pages |
wx.startPullDownRefresh | 2.1.0 | Called only on plug-in pages |
# Current Account Information
API | Minimum Version | Remarks |
---|---|---|
wx.getAccountInfoSync | 2.2.2 |
# Forwarding
API | Minimum Version | Remarks |
---|---|---|
wx.hideShareMenu | 2.1.0 | Called only on plug-in pages |
wx.getShareInfo | 2.1.0 | Called only on plug-in pages |
wx.showShareMenu | 2.1.0 | Called only on plug-in pages |
wx.updateShareMenu | 2.1.0 | Called only on plug-in pages |
# Other
API | Minimum Version | Remarks |
---|---|---|
wx.reportAnalytics | 1.9.6 | See the following remarks. |
# Login and Obtaining User Information
These APIs are called only after user authorization is obtained from the feature page of user information. Otherwise, the calling failed. For details, see Feature Page of User Information.
API | Minimum Version | Remarks |
---|---|---|
wx.login | 2.3.1 | |
wx.getUserInfo | 2.3.1 |
# Bugs & Tips
- wx.reportAnalytics can be called, but statistical display is currently unavailable.