DeveloperDeveloper
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • Standard Solutions
  • Cam Solutions
  • Native SDKs
  • App Gallery
  • Game Engine Plugins
Forum
Projects Library
Dev Discord
  • App Gallery (with Lovense Remote)
    • Get Started
    • Development
    • Deploy
  • Basic API
    • Life Cycle
  • Platform API
    • App Info
      • AppBaseInfo
    • Toy
      • Toy Info
      • Command
      • Feedback Mode
    • Device
      • Accelerometer
      • Screen Orientation
      • Shake
      • Vibrate
    • File System
      • Save Image
  • Open API
    • User Authorization
      • Client API
      • Server API
  • Error Code
  • startShakeListener
  • stopShakeListener
Got Stuck?
Forum for Lovense Developers
Support
Document Feedback

Shake

startShakeListener

  • Description

    Start the shake listener.

  • Parameters

    AttributeTypeDefaultRequiredIntroduction
    successfunctionNoCallback function triggered when the shake listener is successfully started
    failfunctionNoCallback function triggered when the API call fails
  • Example

    const deviceManager = appGallery.getDeviceManager()
    
    // Start Shake Listener
    deviceManager.startShakeListener({
      success() {
        console.log("shake")
      },
      fail(err) {
        console.error(err.code)
        console.error(err.msg)
      },
    })
    

stopShakeListener

  • Description

    Stop the shake listener.

  • Example

    const deviceManager = appGallery.getDeviceManager();
    
    // Stop shake listener
    deviceManager.stopShakeListener();
    
Last Updated:
Prev
Screen Orientation
Next
Vibrate
Explore our Forum or Support to get more inspiration or solve your problems.
Discord Channel
It is an online real-time channel where you can communicate directly with our official administrators or many excellent developers.
Forum
It is a place for Lovense developers to communicate, where you can find solutions to problems or get inspired for your projects.
Support
Find documents and tutorials that may be helpful to you.