Got Stuck?
Forum for Lovense Developers
Support
Document Feedback
Vibrate
vibrateShort
Description
Trigger a short vibration on the phone (around 15ms)
Parameters
Attribute Type Default Required Introduction type string Yes Vibration intensity type, valid values are: heavy, medium, light success function No Callback function triggered when the API call successes fail function No Callback function triggered when the API call fails Success callback function will receive an object with the following attributes:
Attribute Type Introduction code string Success code Example
const deviceManager = appGallery.getDeviceManager(); // Short vibration deviceManager.vibrateShort({ type: "heavy", success(res) { console.log(res.code) }, fail(err) { console.error(err.code) console.error(err.msg) }, });
vibrateLong
Trigger a long vibration on the phone (400ms)
Parameters
Attribute Type Default Required Introduction success function No Callback function triggered when the API call successes fail function No Callback function triggered when the API call fails Example
const deviceManager = appGallery.getDeviceManager(); // Long vibration deviceManager.vibrateLong({ success(res) { console.log(res.code) }, fail(err) { console.error(err.code) console.error(err.msg) }, });