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
  • Native SDKs

    • Introduction
    • Lovense iOS SDK for iPhone app development
    • Lovense Android SDK for Android app development
    • Lovense Windows SDK for Windows app development
Got Stuck?
Forum for Lovense Developers
Click to explore the release pose for iOS SDK
Support
Document Feedback

iOS SDK

The Lovense iOS SDK is a set of application interfaces based on iOS 13.0 and above. Use this SDK to develop applications for iOS mobile devices. By calling the Lovense SDK interface, you can easily control Lovense toys and build applications with rich functions and strong interactivity.

Download Demo

Note

The Lovense iOS SDK now is not support Objective-C, only support Swift. If you need to use Objective-C, you can mix or use the old version.

Step 1: Get your developer token

Go to the developer dashboard and get your developer token.

Step 2: Download and extract the Lovense SDK

Download SDK [Version: 1.5.1, Updated on: May 6, 2025]

Step 3: Include the SDK in your project

Copy the following files to your project main directory.

Add the required framework LovenseKit.xcframework to your project.

Link Lovense iOS SDK

Configure environment:

TARGETS -> General -> Deployment Info -> Deployment Target -> setting 13.0 or above.

TARGETS -> Info -> add key "Required background modes" with item value "bluetooth-central"

Step 4: Connect Lovense toys and send commands

// Import Lovense
import LovenseKit

// Pass your token into Lovense framework
Lovense.shared.setDeveloperToken("token")

// Enable or disable log printing
Lovense.shared.setLogEnable(enable: true)

//Add a scan success notification
NotificationCenter.default.addObserver(self, selector: #selector(scanSuccessCallback),
name: .toyScanSuccess, object: nil)
//Scanning toy success notification
@objc func scanSuccessCallback(nofi : Notification)
{
    let dict = nofi.object as? [String: LovenseToy]
    let scanToyArr = dict?["scanToyArray"]
}

//Add a connect success notification
NotificationCenter.default.addObserver(self, selector: #selector(connectSuccessCallback),
name: .toyConnectSuccess, object: nil)
//Connected toy successfully notification
@objc func connectSuccessCallback(nofi : Notification)
{
    let dict = nofi.object as? [LovenseToy]
    let toy = dict?["toy"]
}

// Search the toys over Bluetooth
Lovense.shared.searchToys()

//Save the toys
Lovense.shared.saveToys(toys)


// Retrieve the saved toys
Lovense.shared.listToys()

// Connect the toy
Lovense.shared.connectToy("toyId")

// Get supported commands
Lovense.shared.getSupportedCommands("toyId")

// Disconnect the toy
Lovense.shared.disconnectToy("toyId")

// Send a command to the toy
Lovense.shared.sendCommand("ToyId",
command: .vibrate,
parameters: [kSendCommandParamKey_VibrateLevel:20])

Command list

CommandDescription
LovenseCommandType.VibrateVibrate the toy. The parameter must be between 0 and 20.
LovenseCommandType.rotateRotate the toy. The parameter must be between 0 and 20.
LovenseCommandType.rotateClockwiseRotate clockwise. The parameter must be between 0 and 20.
LovenseCommandType.rotateAntiClockwiseRotate anti-clockwise. The parameter must be between 0 and 20.
LovenseCommandType.rotateChangeChange the rotation direction
LovenseCommandType.airInAirbag inflation for n seconds. The parameter must be between 1 and 3.
LovenseCommandType.airOutAirbag deflation for n seconds. The parameter must be between 1 and 3.
LovenseCommandType.airAutoCycle airbag inflation for n seconds and air deflation for n seconds. The parameter must be between 0 and 3 (0 means stop).
LovenseCommandType.vibrate1Activate the first vibrator at level n. The parameter must be between 0 and 20.
LovenseCommandType.vibrate2Activate the second vibrator at level n. The parameter must be between 0 and 20.
LovenseCommandType.vibrateFlashVibrate the toy at level n and flash the light at the same time.
LovenseCommandType.flashFlash the light 3 times
LovenseCommandType.lightOffTurn off the light (saved permanently).
LovenseCommandType.lightOnTurn on the light (saved permanently).
LovenseCommandType.getLightStatusGet the light's status (1: on, 0: off)
LovenseCommandType.alightOffTurn off Domi/Domi 2 light (saved permanently)
LovenseCommandType.alightOnTurn on the Domi/Domi 2 light (saved permanently)
LovenseCommandType.getAlightStatusGet the Domi/Domi 2 light status (1: on, 0: off)
LovenseCommandType.getBatteryGet battery level and working status status
LovenseCommandType.getDeviceTypeGet device/toy information
LovenseCommandType.startMoveStart tracking the toy movement (0-4)
LovenseCommandType.stopMoveStop tracking the toy movement
LovenseCommandType.presetVibrate with a preset pattern. Patterns range from 1 to 10. n=0 will stop vibrations.
LovenseCommandType.flexerVibrateControl the vibration of Flexer. The parameter must be between 0 and 20.
LovenseCommandType.flexerFingerControl the fingering motion of Flexer. The parameter must be between 0 and 20.
LovenseCommandType.vibrate3Activate the third vibrator at level n. The parameter must be between 0 and 20.
LovenseCommandType.thrustThrust the toy. The parameter must be between 0 and 20.
LovenseCommandType.solacethrusting/Depth only for the solace toy .The parameter Trusting must be between 0 and 20! Depth must be between 0 and 3!
LovenseCommandType.multiplyControl three vibrators with different strength level for Lapis. Level range is 0 - 20, set level to -1 for remaining strength level from previous function.
LovenseCommandType.getTouchModeGet current mode. The result will be one of [0, 1, 2, 3, 5]
LovenseCommandType.setTouchModeSet current mode. The parameter must be one of [0, 1, 2, 3, 5]
LovenseCommandType.getTouchValueGet touch attenuation value. will return all level value
LovenseCommandType.setTouchValueSet touch attenuation value. The parameter level must be between 1 and 3, attenuation value must be between 0 and 100.
LovenseCommandType.getTouchLevelGet touch attenuation level. The result will be between 1 and 3.
LovenseCommandType.setTouchLevelSet touch attenuation level. The parameter must be between 1 and 3.
LovenseCommandType.lvsSet spped & start & end
LovenseCommandType.oscillateOscillate the toy. The parameter must be between 0 and 20!
LovenseCommandType.getSiteGet position
LovenseCommandType.setSiteSet position
LovenseCommandType.startFeedbackStart tracking the toy movement
LovenseCommandType.endFeedbackStop tracking the toy movement
LovenseCommandType.getAutoSwitchGet auto switch value
LovenseCommandType.setAutoSwitchSet auto switch value
LovenseCommandType.getLightColorget light color value
LovenseCommandType.setLightColorset light color value

Callback list

CallbackDescription
kToyScanSuccessNotificationFound toys
kToyConnectSuccessNotificationToy connected
kToyConnectFailNotificationFailed to connect a toy
kToyConnectBreakNotificationToy disconnection
kToyGetCommandsErrorNotificationFailed to get commands
kToySendCommandErrorNotificationUnknown command received
kToyCallbackNotificationBatteryBattery status
kToyCallbackNotificationDeviceTypeDevice information
kToyCallbackNotificationGetLightStatusLight indicator
kToyCallbackNotificationGetAidLightStatusDomi/Domi 2 light indicator
kToyCallbackNotificationListenMoveToy movement updates
kToyCallbackNotificationTouchModeTouch mode updates
kToyCallbackNotificationTouchValueTouch value updates
kToyCallbackNotificationTouchLevelTouch level updates
kToyCallbackNotificationTouchInteractiveInteractive data updates
kToyCallbackNotificationGetSitesite value
kToyCallbackNotificationSetSitesite value
kToyCallbackNotificationGetAutoSwitchauto switch value
kToyCallbackNotificationGetLightColorlight color value
kToyCommandCallbackNotificationAtSuccessSuccessful command
kToyCommandCallbackNotificationAtErrorCommand exc error

ErrorCode list

NameCodeDescription
LovenseError.illegalCommand901Illegal command
LovenseError.loseAuthorized902Lose authorization
LovenseError.loseToy903Lose toy
LovenseError.losePincode904Lose PIN code
LovenseError.commandExecutionFailure905Command execution failure

Toy Support list

Namevibratevibrate1vibrate2vibrate3rotaterotateClockwiserotateAntiClockwiserotateChangeairInairOutairAutovibrateFlashflashlightOfflightOngetLightStatusalightOffalightOngetAlightStatusgetBatterygetDeviceTypestartMovestopMovepresetflexerVibrateflexerFingerthrustsolacemultiplygetTouchModesetTouchModegetTouchValuesetTouchValuegetTouchLevelsetTouchLevellvsoscillategetSitesetSitestartFeedbackendFeedbackgetAutoSwitchsetAutoSwitchgetLightColorsetLightColor
Ambi✓✓✓✓✓✓✓✓✓✓✓
Calor✓✓✓✓✓✓✓✓✓✓✓✓
Diamo✓✓✓✓✓✓✓✓✓✓
Dolce✓✓✓✓✓✓✓✓✓✓✓✓
Domi✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Domi 2✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Edge✓✓✓✓✓✓✓✓✓✓✓✓
Edge 2✓✓✓✓✓✓✓✓✓✓✓✓
Exomoon✓✓✓✓✓✓✓✓✓✓
Ferri✓✓✓✓✓✓✓✓✓✓
Flexer✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Gemini✓✓✓✓✓✓✓✓✓✓✓✓
Gravity✓✓✓✓✓✓✓✓✓✓✓✓✓
Gush✓✓✓✓✓✓✓✓✓✓
Gush 2✓✓✓✓✓✓✓✓✓✓✓
Hush✓✓✓✓✓✓✓✓✓✓
Hush 2✓✓✓✓✓✓✓✓✓✓
Hyphy✓✓✓✓✓✓✓✓✓✓
Lapis✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Lush✓✓✓✓✓✓✓✓✓✓
Lush 2✓✓✓✓✓✓✓✓✓✓
Lush 3✓✓✓✓✓✓✓✓✓✓✓✓
Lush 4✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Max✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Max 2✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Mini XMachine✓✓✓✓✓✓✓✓✓✓✓
Mission✓✓✓✓✓✓✓✓✓✓
Mission 2✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Nora✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Osci✓✓✓✓✓✓✓✓✓✓✓
Osci 2✓✓✓✓✓✓✓✓✓✓✓
Osci 3✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Ridge✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Solace✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Solace Pro✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓
Tenera✓✓✓✓✓✓✓✓✓✓✓
Tenera 2✓✓✓✓✓✓✓✓✓✓✓
Vulse✓✓✓✓✓✓✓✓✓✓✓✓
XMachine✓✓✓✓✓✓✓✓✓✓✓

Sync to Lovense patterns

After completing the Native SDK integration, you can easily build features that enable users to sync Lovense toys with media by utilizing the Pattern Playback methods. Support iOS 8.0 and above.

Step 1: Initialization

Initialize the pattern player. Call this method every time you start to use the pattern syncing feature.

Note: This method only needs to be called once during the whole process.

ParametersDescriptionTypeRequired
toyIdsThe list of connected toys’ id.NSArrayRequired
pfYour platform’s name. Contact us if you aren’t sure about this.NSStringRequired
Lovense.shared.setupPatternPlayer(toyIds: [toyIds], pf: "your platform")

Step 2: Load Pattern

Load the pattern of the media to be played. Call this method every time you start to use the pattern syncing feature or when there is a change in the toy list.

ParametersDescriptionTypeRequired
mediaIDThe media’s ID from your platform.NSArrayRequired
public enum PatternPrepareState {
    case downloading
    case downloadCompleted
    case downloadFail
}

public func prepareForPattern(mediaId: String, completion: (@MainActor (PatternPrepareState) -> Void)? = nil)

Example

Lovense.shared.prepareForPattern(mediaId: "Your mediaId") { [weak self] state in
    guard let self else { return }
    switch state {
    case .downloading:
        // ...
        break
    case .downloadCompleted:
        // play pattern
        Lovense.shared.playPattern(currentTime: self.currentTime() * 1000)
        case .downloadFail:
        // ...
        break
    @unknown default: break
    }
}

Step 3: Play Pattern

ParametersDescriptionTypeRequired
currentTimeThe playing time duration so far. The default is 0. (in ms)NSTimeIntervalOptional
totalTimeThe total time of media. (in ms)NSTimeIntervalRequired
Lovense.shared.playPattern(currentTime: 0)

Step 4: Sync with Media

If the rate or progress changes while playing the media, call the following methods to re-sync the rate and time.

ParametersDescriptionTypeRequired
rateThe playback rate. The default is 1.0.CGFloatOptional
Lovense.shared.setRate(1.0)
ParametersDescriptionTypeRequired
currentTimeThe playing time duration so far. (in ms)NSTimeIntervalRequired
Lovense.shared.syncCurrentTime(20000)

Pause the pattern when the media is paused or loading, so the toy’s reaction matches the media content.

Lovense.shared.pausePattern()

Calling this method will pause the playing and reset the time to 0.

Lovense.shared.stopPattern()
Last Updated:
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.