my.vibrateShort
Use this JSAPI to trigger a relatively short period of vibration (40 ms) on the device.
Supported types of mini programs: DSL, H5+
Sample Code
DSL
my.vibrateShort({
success: function(res) {
console.log(res);
},
fail: function(err) {
console.log(err);
}
});
H5+
AlipayJSBridge.call('vibrateShort', {}, function (res) {
alert('Result for vibrateShort (JSBridge):\n\n' + JSON.stringify(res));
});Parameters
The incoming parameter is of the Object type with the following properties:
Property | Type | Required | Description |
type | String | No | Indicates the level of the device vibration intensity. If the current device does not support setting the vibration level, the default intensity ( Valid value:
|
success | Function | No | The callback function that is called upon successful call. |
fail | Function | No | The callback function that is called when the JSAPI call fails. When executed, it receives an |
complete | Function | No | The callback function that is called upon call completion (to be executed upon either successful or failed call). |
err object
Parameter | Data type | Required | Description |
error | Number | Yes | An error code that represents the specific error encountered. |
errorMessage | String | Yes | An error message that describes the corresponding error code. |