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
  • getMyToysInfo
  • getMyToysInfoAsync
  • onMyToysChange
  • openMyToysDialog
  • Toy List
Got Stuck?
Forum for Lovense Developers
Support
Document Feedback

Toy Info

getMyToysInfo

  • Description

    Get the information of toy list.

  • Parameters

    AttributeTypeDefaultRequiredIntroduction
    successfunctionNoCallback function for successful API call
    failfunctionNoCallback function for failed API call

    Success callback function will receive an object with the following attributes:

    AttributeTypeIntroduction
    toyListArrayToy List

    Success callback function received parameters data example:

    {
      "toyList": [
        {
          "showName": "Lush",
          "alias": "mylove",
          "firmwareVersion": "",
          "type": "lush",
          "toyId": "6c5cb14619b1",
          "battery": "98",
          "status": "0",
          "isSupportFeedbackMode": true,
          "sendOrder": function (v) {},
          "stop": function () {}
        }, 
        {
          "showName": "Ridge",
          "alias": "",
          "firmwareVersion": "",
          "type": "ridge",
          "toyId": "e0798d436ab4",
          "battery": "98",
          "status": "1",
          "isSupportFeedbackMode": true,
          "sendOrder": function (v) {},
          "stop": function () {}
        }
      ]
    }
    

    Fail callback function will receive an object with the following attributes:

AttributeTypeIntroduction
codestringError code
msgstringError message
  • Example

    const toyManager = appGallery.getToyManager()
    
    // Get the toy information
    toyManager.getMyToysInfo({
      success(res) {
        console.log(res.toyList)
      },
      fail(err) {
        console.error(err.code)
        console.error(err.msg)
      },
    })
    

getMyToysInfoAsync

  • Description

    The Promisify version of getMyToysInfo.

  • Return Values

    Promise

  • Example

    const toyManager = appGallery.getToyManager()
    toyManager.getMyToysInfoAsync().then(res=>{
      console.log(res.toyList)
    }).catch(err=>{
      console.error(err.code)
      console.error(err.msg)
    })
    

onMyToysChange

  • Description

Set up a listener to receive updates on the connection status or quantity of toys. This will allow you to retrieve the latest information about your toys.

  • Parameters

    AttributeTypeDefaultRequiredIntroduction
    callbackfunctionYesListener function for toy connection status or quantity changes.

    The callback function will receive an object with the following attributes:

    AttributeTypeIntroduction
    toyListArrayToy List
  • Example

    const toyManager = appGallery.getToyManager()
    
    // Listen to changes in my toys
    toyManager.onMyToysChange(function (res) {
      console.log(res.toyList)
    })
    

openMyToysDialog

  • Description

    Open the pop-up window of my toy page.

  • Example

    const toyManager = appGallery.getToyManager()
    
    // Open My Toy Page
    toyManager.openMyToysDialog()
    

Toy List

When using getMyToysInfo to get toy list or onMyToysChange to listen for changes in the toy list, you will get data related to the toy list.

For each item in a toy list are as follows:

AttributeTypeIntroduction
showNamestringToy Name
aliasstringToy Alias, empty string if not available
firmwareVersionstringToy Firmware Version
typestringToy Type, lowercase letters
toyIdstringToy MAC Address, lowercase letters, e.g. 6c5cb14619b1
batterystringToy Battery Level, percentage value without the percentage sign
statusstringToy Connection Status ("-1": Disconnected, "0": Connecting, "1": Connected)
isSupportFeedbackModebooleanToy Feedback Mode Support (true/false)
sendOrderfunctionSend simple command (0-100). Parameter: number or object. If it is a number, it is automatically converted to a complete command. If it is an object, it is executed by a specific command, for example, {v: value, t: value}.
stopfunctionStop toy vibration
Last Updated:
Next
Command
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.