IoTDeviceManager
@objc
public class IoTDeviceManager : NSObject
A singleton class for performing all the workflows related to IoT devices.
-
Associate an IoT device to the current user.
Declaration
Swift
@objc public static func addIoTDevice(device: IoTDevice, completion: @escaping (NSError?) -> Void)Parameters
deviceThe IoT device model which contains the information.
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Deassociate an IoT device from the current user.
Declaration
Swift
@objc public static func removeIoTDevice(device: IoTDevice, completion: @escaping (NSError?) -> Void)Parameters
deviceThe IoT device model which contains the information.
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Update the IoT device information for the current user.
Declaration
Swift
@objc public static func updateIoTDevice(device: IoTDevice, completion: @escaping (NSError?) -> Void)Parameters
deviceThe IoT device model which contains the information.
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Retrieve the list of IoT devices associated with the current user.
Declaration
Swift
@objc public static func getIoTDeviceList(completion: @escaping ([IoTDevice], NSError?) -> Void)Parameters
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Send invitation to a secondary user to have access to an IoT device.
Declaration
Swift
@objc public static func sendInvite(recipient: String, iotId: String, iotType: IOTType = .internalVIN, content: [String: String], completion: @escaping (NSError?) -> Void)Parameters
recipientRecipient ID.
iotIdIoTDevice ID.
iotTypeIoTDevice type. Default is
.vehicle.contentthe content sent with the invitation.
completionBlock that will be called once sending is completed. The block will provide an error object if something went wrong.
-
Request to have access to an IoT device.
Declaration
Swift
@available(*, deprecated, message: "API Endpoint no longer exists.") @objc public static func requestAccess(iotId: String, completion: @escaping (NSError?) -> Void)Parameters
iotIdIoTDevice ID.
completionBlock that will be called once request is completed. The block will provide an error object if something went wrong.
-
Fetch all invitation or request messages from servers.
Declaration
Swift
@objc public static func getMessages(purpose: MessagePurpose, status: MessageStatus = .any, type: MessageType, iotId: String, iotType: IOTType = .internalVIN, completion: @escaping ([Message]?, NSError?) -> Void)Parameters
purposeThe purpose of the messages (see
MessagePurpose).statusThe status of the message. Default is
.pending.typeMessage Type.
iotIdIoTDevice ID.
iotTypeIoTDevice type. Default is
.vehicle.completionBlock that will be called once fetch is completed. The block will provide list of message if successful or an error object if something went wrong.
-
Approve a secondary user to have access to an IoT device.
Declaration
Swift
@available(*, deprecated, message: "API Endpoint no longer exists.") @objc public static func approveAccess(messageId: String, completion: @escaping (NSError?) -> Void)Parameters
messageIdMessage ID to approve request.
completionBlock that will be called once approval is completed. The block will provide an error object if something went wrong.
-
Delete an invitation/access message.
Declaration
Swift
@objc public static func deleteMessage(messageId: String, completion: @escaping (NSError?) -> Void)Parameters
messageIdID of the message.
completionBlock that will be called once deletion is completed. The block will provide an error object if something went wrong.
-
Transfer ownership of an IoT device to a secondary user.
Declaration
Swift
@available(*, deprecated, message: "API Endpoint no longer exists.") @objc public static func transferOwnership(iotId: String, iotType: IOTType = .vehicle, transferTo: String, completion: @escaping (NSError?) -> Void)Parameters
iotIdIoTDevice ID.
iotTypeIoTDevice type. Default is
.vehicle.transferToThe ID of the secondary user.
completionBlock that will be called once transfer is completed. The block will provide an error object if something went wrong.
-
Revoke the secondary user’s access to an IoT device.
Declaration
Swift
@available(*, deprecated, message: "API Endpoint no longer exists.") @objc public static func revokeSecondaryUser(iotId: String, iotType: IOTType = .vehicle, revokeFrom: String, completion: @escaping (NSError?) -> Void)Parameters
iotIdIoTDevice ID.
iotTypeIoTDevice type. Default is
.vehicle.revokeFromID of the secondary user.
completionBlock that will be called once revoke action is completed. The block will provide an error object if something went wrong.
-
Deassociate a IoT Device from the current user.
Declaration
Swift
@available(*, deprecated, message: "API Endpoint no longer exists.") @objc public static func disconnectIoTDevice(_ device: IoTDevice, completion: @escaping (NSError?) -> Void)Parameters
deviceThe device to be disconnected.
completionBlock that will be called once disconnecting is completed. The block will provide an error object if something went wrong.
-
Accept an invite to be secondary user for an IoT device.
Declaration
Swift
@objc public static func acceptInvite(invitationCode: String, _ completion: ((NSError?) -> Void)?)Parameters
invitationCodeThe code received as part of the
Messageobject.completionThe block that will be called when the accept invitation workflow finishes.
-
Reject an invite to be secondary user for an IoT device.
Declaration
Swift
@objc public static func rejectInvite(invitationCode: String, _ completion: ((NSError?) -> Void)?)Parameters
invitationCodeThe code received as part of the
Messageobject.completionThe block that will be called when the reject invitation workflow finishes.
IoTDeviceManager Class Reference