AWSIoTMQTTConfiguration Class Reference

Inherits from NSObject
Declared in AWSIoTDataManager.h
AWSIoTDataManager.m

  baseReconnectTimeInterval

The time in seconds to wait before attempting the first reconnect. If the MQTT client becomes disconnected, it will attempt to reconnect after a quiet period; this quiet period doubles with each failed connection attempt, e.g. 1 second, 2 seconds, 4, 8, 16, 32, etc… up until a maximum reconnection time (maximumReconnectTimeInterval) is reached. If a connection is active for the minimum connection time (minimumConnectionTimeInterval), the quiet period is reset to the initial value. Default value: 1 second.

@property (nonatomic, assign, readonly) NSTimeInterval baseReconnectTimeInterval

Declared In

AWSIoTDataManager.h

  minimumConnectionTimeInterval

The time in seconds that a connection must be active before resetting the current reconnection time to the base reconnection time. Default value: 20 seconds.

@property (nonatomic, assign, readonly) NSTimeInterval minimumConnectionTimeInterval

Declared In

AWSIoTDataManager.h

  maximumReconnectTimeInterval

The maximum time in seconds to wait prior to attempting to reconnect. Default value: 128 seconds.

@property (nonatomic, assign, readonly) NSTimeInterval maximumReconnectTimeInterval

Declared In

AWSIoTDataManager.h

  keepAliveTimeInterval

The MQTT keep-alive time in seconds. Default value: 60s seconds.

@property (nonatomic, assign, readonly) NSTimeInterval keepAliveTimeInterval

Declared In

AWSIoTDataManager.h

  lastWillAndTestament

The last will and testament (LWT) to be used when connecting to AWS IoT; in the event that this client disconnects improperly, AWS IoT will use this to notify any interested clients. Default value: nil

@property (atomic, strong, readonly) AWSIoTMQTTLastWillAndTestament *lastWillAndTestament

Declared In

AWSIoTDataManager.h

  runLoop

The run loop to execute the MQTT client in. Default value: [NSRunLoop currentRunLoop]

@property (atomic, strong, readonly) NSRunLoop *runLoop

Declared In

AWSIoTDataManager.h

  runLoopMode

The run loop mode to use when executing the MQTT client. Default value: NSDefaultRunLoopMode

@property (nonatomic, strong, readonly) NSString *runLoopMode

Declared In

AWSIoTDataManager.h

  autoResubscribe

Boolean flag to indicate whether auto-resubscribe feature is enabled. Default value: YES When enabled, in the event of abnormal network disconnection, the sdk automatically subscribes to previously subscribed topics.

@property (nonatomic, assign, readonly) BOOL autoResubscribe

Declared In

AWSIoTDataManager.h

– initWithKeepAliveTimeInterval:baseReconnectTimeInterval:minimumConnectionTimeInterval:maximumReconnectTimeInterval:runLoop:runLoopMode:autoResubscribe:lastWillAndTestament:

Create an AWSIoTMQTTConfiguration object and initialize its parameters. The AWSIoTMQTTConfiguration object is then passed to AWSIoTDataManager to initialize it. Note, clients need to either specify all parameters explicitly or not customize any parameter in which case default parameter values will be used to initialize AWSIoTMqttConfiguration.

- (instancetype)initWithKeepAliveTimeInterval:(NSTimeInterval)kat baseReconnectTimeInterval:(NSTimeInterval)brt minimumConnectionTimeInterval:(NSTimeInterval)mct maximumReconnectTimeInterval:(NSTimeInterval)mrt runLoop:(NSRunLoop *)rlp runLoopMode:(NSString *)rlm autoResubscribe:(BOOL)ars lastWillAndTestament:(AWSIoTMQTTLastWillAndTestament *)lwt

Parameters

kat

keepAliveTimeInterval, Mqtt Keep Alive time in seconds

brt

baseReconnectTimeInterval, The time in seconds to wait before attempting the first reconnect

mct

minimumConnectionTimeInterval, The time in seconds that a connection must be active before resetting the current reconnection time to the base reconnection time.

mrt

maximumReconnectTimeInterval, The maximum time in seconds to wait prior to attempting to reconnect

rlp

The run loop to execute the MQTT client in

rlm

The run loop mode to use when executing the MQTT client

ars

autoResubscribe, Boolean flag to indicate whether auto-resubscribe feature is enabled

lwt

lastWillAndTestament, The last will and testament (LWT) to be used when connecting to AWS IoT

Declared In

AWSIoTDataManager.h