Got Stuck?
Forum for Lovense Developers
Support
Document Feedback
Screen Orientation
setScreenOrientation
Description
Set screen orientation.
Parameters
Attribute Type Default Required Introduction orientation string Yes Screen orientation, portrait: "portrait", landscape: "landscape" 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 Fail callback function will receive an object with the following attributes:
Attribute Type Introduction code string Error code msg string Error message Example
const deviceManager = appGallery.getDeviceManager();
// Set screen orientation
deviceManager.setScreenOrientation({
orientation: "landscape",
success(res) {
console.log(res.code)
},
fail(err) {
console.error(res.code)
console.error(res.msg)
},
});