Lovense Class Reference

Inherits from NSObject
Declared in Lovense-Swift.h

Overview

  • This class contains all the required functions to the Lovense toys

+ setDeveloperToken:

  • Set developer's token

+ (void)setDeveloperToken:(NSString *__nonnull)token

Discussion

  • Set developer's token

Declared In

Lovense-Swift.h

– searchToys:failure:

Start searching Lovense toys through Bluetooth

- (void)searchToys:(void ( ^ __nonnull ) ( LovenseToy *__nonnull ))success failure:(void ( ^ __nonnull ) ( LovenseError *__nonnull ))failure

Parameters

success

Callback method when toys found

failure

Callback method when there is an error

Discussion

Start searching Lovense toys through Bluetooth

Declared In

Lovense-Swift.h

– stopSearchingWithSync:

Stop searching toys

- (void)stopSearchingWithSync:(BOOL)sync

Discussion

Stop searching toys

Declared In

Lovense-Swift.h

– saveToys:failure:

Save a list of found toys ( this may overwrite the existing toys)

- (void)saveToys:(NSArray *__nonnull)toys failure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

Save a list of found toys ( this may overwrite the existing toys)

Declared In

Lovense-Swift.h

– listToysWithFailure:

List the saved toys.

- (NSArray *__nonnull)listToysWithFailure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

List the saved toys.

Declared In

Lovense-Swift.h

– removeToyById:failure:

Remove a saved toy.

- (void)removeToyById:(NSString *__nonnull)id failure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

Remove a saved toy.

Declared In

Lovense-Swift.h

– sendCommand:command:param:callback:failure:

Send command to a toy.
  • id: The toy ID

  • command: The command to be sent

  • param: The parameter

  • callback(Bluetooth status, the command, the parameter): Callback method for result.

- (void)sendCommand:(NSString *__nonnull)id command:(enum LovenseOrderType)command param:(NSInteger)param callback:(void ( ^ __nullable ) ( NSString *__nonnull , enum LovenseOrderType , NSInteger ))callback failure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

Send command to a toy.
  • id: The toy ID

  • command: The command to be sent

  • param: The parameter

  • callback(Bluetooth status, the command, the parameter): Callback method for result.

Declared In

Lovense-Swift.h

– connectToy:callback:failure:

Connect to a specified toy through Bluetooth.
  • callback(toy's id, connection status, failure reasons)

- (void)connectToy:(NSString *__nonnull)id callback:(void ( ^ __nullable ) ( NSString *__nonnull , BOOL ))callback failure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

Connect to a specified toy through Bluetooth.
  • callback(toy's id, connection status, failure reasons)

Declared In

Lovense-Swift.h

– disconnectToy:failure:

Disconnect to a specified toy through Bluetooth.
  • callback(toy's id, connection status, failure reasons)

- (void)disconnectToy:(NSString *__nonnull)id failure:(void ( ^ __nullable ) ( LovenseError *__nonnull ))failure

Discussion

Disconnect to a specified toy through Bluetooth.
  • callback(toy's id, connection status, failure reasons)

Declared In

Lovense-Swift.h