Lists available WindVane miniapp JSAPIs with platform support for Android and iOS.
Basics
|
API |
Description |
Android |
iOS |
|
WVBase.copyToClipboard |
Copies the specified text to the clipboard. |
Y |
Y |
|
WVBase.isInstall |
Checks whether the specified app is installed. |
Y |
Y |
|
WVBase.isAppsInstalled |
Checks whether the specified apps are installed. |
Y |
Y |
|
WVBase.notify |
Dispatches an event on |
N |
Y |
|
WVBase.openBrowser |
Opens the specified URL in a new Safari window. |
N |
Y |
|
WVBase.setBackgroundColor |
Sets the background color of the WebView. |
N |
Y |
|
WVBase.canIUse |
Checks if the current version supports the specified API. |
Y |
Y |
|
WVMiniApp.close |
Closes the miniapp. |
Y |
Y |
Navigation
|
Parameter |
Description |
Android |
iOS |
|
WVNavigator.pop |
Closes the current page. |
Y |
Y |
|
WVNavigator.push |
Opens a new page in the miniapp. |
Y |
Y |
Interaction
|
API |
Description |
Android |
iOS |
|
WVUI.showLoadingBox |
Displays a loading box. |
Y |
Y |
|
WVUI.hideLoadingBox |
Hides the loading box. |
Y |
Y |
|
WVUI.hideKeyboard |
Hides the keyboard. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVUIToast.toast |
Displays a toast — a brief message in the center of the screen. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVUIDialog.alert |
Displays an alert. |
Y |
Y |
|
WVUIDialog.confirm |
Displays a confirmation dialog. |
Y |
Y |
|
WVUIDialog.enableAlertBeforeUnload |
Shows a confirmation dialog when the user presses back to close the miniapp page. |
Y |
Y |
|
WVUIDialog.disableAlertBeforeUnload |
Disables the back-button confirmation dialog. |
Y |
Y |
|
WVUIDialog.prompt |
Displays a dialog that prompts for text input. |
Y |
Y |
|
WVUIDialog.showAuthGuide |
Displays a dialog with text and illustrations to guide the user in granting permissions. |
Y |
Y |
|
WVUIDatePicker.show |
Displays a date picker. Defaults to the current date if no default is set. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVUIActionSheet.show |
Displays an action sheet at the bottom of the screen. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVNavigationBar.update |
Configures the navigation bar of the current page. |
Y |
Y |
|
WVNavigationBar.getHeight |
Gets the height of the miniapp's navigation bar. |
Y |
Y |
Multimedia
|
API |
Description |
Android |
iOS |
|
WVImage.saveImage |
Saves an image from an HTTP(S) URL or base64 string to the album. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVVideo.chooseVideo |
Shoots a video or selects a video from an album. |
Y |
Y |
|
WVVideo.saveVideoToPhotosAlbum |
Saves a video to the system album. |
Y |
Y |
|
API |
Description |
Android |
iOS |
|
WVAudio.playSystemSound |
Plays the specified system sound. |
N |
Y |
|
API |
Description |
Android |
iOS |
|
WVCamera.takePhoto |
Takes a photo or selects one from an album. Supports auto-upload if the native app implements the upload protocol. |
Y |
Y |
|
WVCamera.confirmUploadPhoto |
Confirms the photo upload. |
Y |
Y |
Cache
|
Parameter |
Description |
Android |
iOS |
|
WVStorage.setItem |
Stores data for a specified key in the local cache. |
Y |
Y |
|
WVStorage.getItem |
Retrieves the data for a specified key from the local cache (asynchronous). |
Y |
Y |
|
WVStorage.removeItem |
Removes the data for a specified key from the local cache. |
Y |
Y |
|
WVStorage.clearStorage |
Clears the local cache (asynchronous). |
Y |
Y |
|
WVStorage.clearStorageSync |
Clears the local cache (synchronous). |
Y |
Y |
File
|
API |
Description |
Android |
iOS |
|
WVFile.write |
Writes file content to disk. |
Y |
Y |
|
WVFile.read |
Reads the content of a file. |
Y |
Y |
|
WVFile.getFileInfo |
Gets file information. |
Y |
Y |
|
WVFile.downloadFile |
Downloads a file locally. |
Y |
Y |
|
WVFile.uploadFile |
Uploads a file to a server URL. |
Y |
Y |
|
WVFile.chooseFiles |
Selects one or more local files for upload. |
Y |
Y |
|
WVFile.getDataByFilePath |
Gets a local file's data by path. |
Y |
Y |
Geographic location
|
Parameter |
Description |
Android |
iOS |
|
WVLocation.getLocation |
Gets the current geographic location. |
Supported |
Supported |
|
WVLocation.searchLocation |
Searches for the latitude and longitude of an address. |
Not supported |
Supported |
Cross-origin
|
Parameter |
Description |
Android |
iOS |
|
WVCookie.read |
Reads all cookies from a specified URL. |
Y |
Y |
|
WVCookie.write |
Sets a cookie for a specified URL. |
Y |
Y |
Device
|
Parameter |
Description |
Android |
iOS |
|
WVSystem.getSystemInfo |
Gets the system information of the device. |
Y |
Y |
|
WVSystem.getSystemInfoSync |
Synchronously gets the system information of the device. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVNativeDetector.isSimulator |
Checks whether the current environment is a simulator. |
Y |
Y |
|
WVNativeDetector.getCurrentUsage |
Gets the current CPU utilization and memory usage. |
Y |
Y |
|
WVNativeDetector.getDeviceYear |
Gets the device release year for performance estimation. Accurate on iOS; approximate on Android. |
Y |
Y |
|
WVNativeDetector.getModelInfo |
Gets device information, such as the device model. |
Y |
Y |
|
WVNativeDetector.getSafeAreaInsets |
Gets the safe area insets of the current page. Full-screen pages only. |
N |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVNetwork.getNetworkType |
Gets the current network type. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVScreen.getOrientation |
Gets the current display orientation (landscape or portrait). |
Y |
Y |
|
WVScreen.setOrientation |
Sets the current display orientation (landscape or portrait). |
Y |
Y |
|
WVScreen.setScreenBrightness |
Sets the screen brightness. |
Y |
Y |
|
WVScreen.getScreenBrightness |
Gets the screen brightness. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVScreenCapture.capture |
Captures a screenshot of the visible WebView area. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVMotion.listenBlow |
Starts listening for blow gestures. |
Y |
Y |
|
WVMotion.stopListenBlow |
Stops listening for blow gestures. |
Y |
Y |
|
WVMotion.listenGyro |
Enables or disables listening for the gyroscope. |
Y |
Y |
|
WVMotion.listeningShake |
Enables or disables listening for the shake gesture. |
Y |
Y |
|
WVMotion.vibrate |
Makes the device vibrate. |
Y |
Y |
|
WVMotion.startAccelerometer |
Starts listening for acceleration data. |
Y |
Y |
|
WVMotion.stopAccelerometer |
Stops listening for acceleration data. |
Y |
Y |
|
WVMotion.startCompass |
Starts listening for compass data. |
Y |
Y |
|
WVMotion.stopCompass |
Stops listening for compass data. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVNotification.beep |
Makes the device beep. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVCall.dial |
Opens the dialpad. |
Y |
Y |
|
WVCall.call |
Makes a phone call directly. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVApplication.appState |
Gets the app's current state (foreground or background). |
N |
Y |
|
WVApplication.getNotificationSettings |
Gets the notification settings for the application. |
N |
Y |
|
WVApplication.openSettings |
Opens the settings page for the current application. |
N |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVContacts.askAuth |
Requests permission to access contacts. |
N |
Y |
|
WVContacts.authStatus |
Gets the current permission status for accessing contacts. |
N |
Y |
|
WVContacts.choose |
Opens the contacts list and returns the selected contact's name and phone number. |
Y |
Y |
|
WVContacts.find |
Searches for contacts by name and phone number. |
Y |
Y |
|
WVContacts.addPhoneContact |
Adds a contact. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVScan.scan |
Starts the code scanner. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVBattery.getBatteryInfo |
Asynchronously gets the battery level. |
Y |
Y |
|
WVBattery.getBatteryInfoSync |
Synchronously gets the battery level. |
Y |
Y |
|
Parameter |
Description |
Android |
iOS |
|
WVBluetooth.requestAuthorization |
Requests Bluetooth permissions and enables Bluetooth. |
Y |
Y |
|
WVBluetooth.scan |
Scans for nearby Bluetooth Low Energy (BLE) devices. |
Y |
Y |
|
WVBluetooth.stopScan |
Stops scanning for BLE devices. |
Y |
Y |
|
WVBluetooth.connect |
Connects to a BLE device at the specified address. |
Y |
Y |
|
WVBluetooth.disconnect |
Disconnects from a connected BLE device. |
Y |
Y |
|
WVBluetooth.getServices |
Discovers services on a connected BLE device. |
Y |
Y |
|
WVBluetooth.getCharacteristics |
Discovers the characteristics of a specified service. |
Y |
Y |
|
WVBluetooth.writeValue |
Writes a value to a specified characteristic on a connected BLE device. |
Y |
Y |
|
WVBluetooth.readValue |
Reads the value of a specified characteristic from a connected BLE device. |
Y |
Y |
|
WVBluetooth.startNotifications |
Enables notifications for a characteristic's value changes. |
Y |
Y |
|
WVBluetooth.stopNotifications |
Disables notifications for a characteristic's value changes. |
Y |
Y |
Communication
|
API |
Description |
Android |
iOS |
|
WVStandardEventCenter.postNotificationToNative |
Sends a named event from the miniapp to the native application. The event name can be any name agreed upon with the native team. |
Y |
Y |
Other features
|
API |
Description |
Android |
iOS |
|
WindVaneReady |
Triggered when a page finishes loading. Listen for the WindVaneReady event to check load status. |
Y |
Y |
|
Background |
Triggers the WV.Event.APP.Background event when the app moves to the background (user switches apps or opens the notification shade). |
Y |
Y |
|
Active |
Triggers the WV.Event.APP.Active event when the app returns from the background. |
Y |
Y |