This document includes all the APIs involved in mPaaS Mini Program. See the corresponding API documents for the specific API details.
UI
Navigation bar
Name | Features |
---|---|
Get the background color of the navigation bar. | |
Hide the “Back to Homepage” icon on the title bar. | |
Hide loading animation on the navigation bar of the current page. | |
Show loading animation on the navigation bar of the current page. | |
Set navigation bar style including title, background color, bottom border color, and logo image in the upper-left corner of the navigation bar. |
tabBar
Name | Features |
---|---|
Hide tabBar. | |
Hide the red dot in the upper-right corner of an item on the tabBar. | |
Remove text in the upper-right corner of an item on the tabBar. | |
Add text in the upper-right corner of an item on the tabBar. You can use red dot reminder to set the number of messages. | |
Set the content of an item on the tabBar dynamically. | |
Set the general style of tabBar dynamically, such as font color, tab background color, and label border color. | |
Show tabBar. | |
Show the red dot in the upper-right corner of an item on the tabBar. | |
You can click a tab to trigger the function and listen to the events of tabBar click. | |
Answers to FAQ regarding tab. |
Routes
Name | Features |
---|---|
Switch to the specific tabBar page and close all the irrelevant pages. | |
Close all the current pages and relaunch to the specific page in the application. | |
Close the current page and redirect to the specific page in the application. | |
Navigate to the specific page in the application from the current page. | |
Close the current page and navigate back to the previous level or multilevel page. | |
Answers to FAQ regarding routes. |
Interaction feedback
Name | Features |
---|---|
Alert box (alert). | |
Confirm box (confirm). | |
You can enter text in the prompting dialogue box. | |
Show a toast. You can set the time that the toast lasts. | |
Hide toasts. | |
Show loading prompts. | |
Hide loading prompts. | |
Show action sheet. |
Pull-down refresh
Name | Features |
---|---|
Listen to the pull-down refresh events that are performed by users on this page. | |
Stop the operations of pull-down refresh on the current page. | |
Start the operations of pull-down refresh. |
Contact
Name | Features |
---|---|
Select the phone number of a contact in the directory of the local system. |
Choose city
Name | Features |
---|---|
You can call this operation to open the city list. | |
You can customize | |
You can call this operation to modify the default name of the located city in |
Choose date
Name | Features |
---|---|
Open the date picker list. |
Animation
Name | Features |
---|---|
Create animation instances. |
Canvas
Name | Features |
---|---|
Create canvas drawing context. |
Keypad
Name | Features |
---|---|
Hide keypad. |
Scroll
Name | Features |
---|---|
Scroll to the target location on the page. |
Node query
Name | Features |
---|---|
Get a node query object |
Option selector
Name | Features |
---|---|
A component similar to the native Safari select but with more powerful features, which you can use to replace select or level 2 data. Note: The component does not support interactions among level 2 data. |
Multilevel select
Name | Features |
---|---|
Business scenarios for relevant multilevel data selection such as the information selection of province, city, and region. |
Set background window
Name | Features |
---|---|
Set the background color of the settings window dynamically. | |
Set the font of the pull-down background, and the style of loading graphic dynamically. |
Set page pulldown
Name | Features |
---|---|
Set if the page supports pull down operations. By default, the page in the mini program supports pull down operations. |
Set optionMenu
Name | Features |
---|---|
Configure extra icons on the optionMenu navigation bar, and then click to trigger |
Multimedia
Image
Name | Features |
---|---|
Take photos or select images from your mobile phone album. | |
Preview images. | |
Save online images to your mobile phone album. | |
Compress images. | |
Get image information. |
Storage
Name | Features |
---|---|
The operation to save data in the specific key of the local storage will overwrite the corresponding data to this key. | |
Synchronize data in the specific key of the local storage. | |
Get data from the storage asynchronously. | |
Get data from the storage synchronously. | |
Remove asynchronous operations for data storage. | |
Remove synchronous operations for data storage. | |
Clear asynchronous operations for local data storage. | |
Clear synchronous operations for local data storage. | |
Get relevant information for the current storage asynchronously. | |
Get relevant information for the current storage synchronously. |
File
Name | Features |
---|---|
Save file to local system. The maximum local file size is 10 MB. | |
Get file information. | |
Get the saved file information. | |
Get all the save files. | |
Remove a saved file. |
Network
Name | Features |
---|---|
Network request of the mini program. | |
Upload local resource to the developer server. | |
Download files to the local system. | |
Create a WebSocket connection. | |
Listen to the events of WebSocket connection open. | |
Stop listening to the events of WebSocket connection off. | |
Listen to WebSocket errors. | |
Stop listening to WebSocket errors. | |
Send data through WebSocket connection. | |
Listen to the message events on the server received by WebSocket. | |
Stop listening to message events on the server received by WebSocket. | |
Close WebSocket connection. | |
Listen to close WebSocket connection. | |
Stop listening to close WebSocket connection. |
Device
canIUse
Name | Features |
---|---|
Determine if the current version supports API operations, input parameters or output values, components, and attributes of the current mini program. |
Get base library version number
Name | Features |
---|---|
Get the version number of the base library. For reference only, do not rely on this value for code logic. |
System information
Name | Features |
---|---|
Get mobile phone system information. | |
Get the synchronous operation for mobile phone system information. |
Network status
Name | Features |
---|---|
Get current network status. | |
Start listening to network status changes. | |
Stop listening to network status changes. |
Clipboard
Name | Features |
---|---|
Get clipboard data. | |
Set clipboard data. |
Shake
Name | Features |
---|---|
Use shake feature. Every time you call the API, the callback will be triggered after you shake the mobile phone. If you need to listen again, you have to recall this API. |
Vibrate
Name | Features |
---|---|
Use vibrate feature. | |
Long vibration lasts for 400 ms. | |
Short vibration lasts for 40 ms. |
Accelerometer
Name | Features |
---|---|
Listen to accelerometer data. | |
Stop listening to accelerometer data. |
Gyroscope
Name | Features |
---|---|
Listen to the events of gyroscope data change. | |
Stop listening to gyroscope data. |
Compass
Name | Features |
---|---|
Listen to compass data. | |
Stop listening to compass data. |
Make phone calls
Name | Features |
---|---|
Make phone calls. |
Events of user capture screen
Name | Features |
---|---|
Listen to the events of active screen capture initiated by the user. | |
Stop listening to the events of screen capture. |
Screen brightness
Name | Features |
---|---|
Set whether to keep the screen on. | |
Get screen brightness. | |
Set screen brightness. |
Add phone contact
Name | Features |
---|---|
You can add the list to the directory in the mobile phone system by Create New Contact or Add to Existing Contact. |
Scan
Name | Features |
---|---|
Use scan feature. |
Bluetooth
Name | Features |
---|---|
Initialize Bluetooth module of the mini program. | |
Turn off the local Bluetooth module. | |
Get the status of the local Bluetooth module. | |
Start searching for nearby Bluetooth devices. | |
Stop searching for nearby Bluetooth devices. | |
Get all discovered Bluetooth devices, including the Bluetooth device that is already connected. | |
Get connected devices. | |
Connect to the Bluetooth Low Energy (BLE) device. | |
Disconnect from the BLE device. | |
Write data into the characteristic value of the BLE device. | |
Read the data from the characteristic value of the BLE device. | |
Enable the notify feature for the characteristic value change of the BLE device. | |
Get all the services of Bluetooth devices. | |
Get all the characteristic values of Bluetooth devices. | |
This event is triggered when a new Bluetooth device is found. | |
Stop listening to the events of searches for new Bluetooth devices. | |
Listen to the events of characteristic value changes of the BLE device. | |
Stop listening to the events of characteristic value changes of the BLE device. | |
Listen to the events of BLE connection errors, such as device loss and abnormal disconnection. | |
Stop listening to the events of connection status changes of the BLE device. | |
Listen to the events of local Bluetooth status changes. | |
Stop listening to the events of local Bluetooth status changes. | |
List for the error code of Bluetooth API. |
Data security
Name | Features |
---|---|
Asymmetric encryption. |
Share
Name | Features |
---|---|
Customize | |
Hide Share button. |
Current running version
Name | Features |
---|---|
Get the running version of the current mini program. |
Custom analysis
Name | Features |
---|---|
Customize the report operation of data analysis. |
Mini program redirection
Name | Features |
---|---|
Navigate to other mini programs. | |
You can navigate back to the previous mini program only when another mini program is navigated to the active mini program. |
webview component control
Name | Features |
---|---|
Create and return | |
You can bind |