Loading...
Searching...
No Matches
MqttSessionExample Class Reference
+ Inheritance diagram for MqttSessionExample:

Public Member Functions

void cleanup ()
 
(void) - onConnected
 Called when MQTT session has been successfully connected to the server.
 
(void) - onError:
 Called if MQTT session connection failed or was lost.
 
(void) - onMessagePublished
 Called when a message has been successfully published to MQTT broker. This callback is invoked after a message (either position data or custom message) has been successfully sent to the MQTT broker.
 

Public Attributes

NavigineSdk _sdk
 
LocationManager _locationManager
 
NavigationManager _navigationManager
 
MqttSession _mqttSession
 
MqttSessionListener _mqttSessionListener
 

Properties

NCNavigineSdksdk
 
NCLocationManagerlocationManager
 
NCNavigationManagernavigationManager
 
NCMqttSessionmqttSession
 

Detailed Description

MqttSession usage example for Dart/Flutter Demonstrates working with MQTT session for publishing position data

MqttSession usage example for Objective-C Demonstrates working with MQTT session for publishing position data

Definition at line 8 of file mqtt_session_example.dart.

Member Function Documentation

◆ cleanup()

void MqttSessionExample.cleanup ( )
inline

Clean up resources

Definition at line 228 of file MqttSessionExample.m.

◆ onConnected

- (void) onConnected

Called when MQTT session has been successfully connected to the server.

Swift code snippet:

func onConnected() {
print("MQTT session connected successfully")
}

Objective C code snippet:

- (void)onConnected {
NSLog(@"MQTT session connected successfully");
}

◆ onError:

- (void) onError: (nullable NSError *) error

Called if MQTT session connection failed or was lost.

Parameters
errorhandled error.

Swift code snippet:

func onError(_ error: Error?) {
if let error = error {
print("MQTT session error: \‍(error.localizedDescription)")
}
}

Objective C code snippet:

- (void)onError:(NSError *)error {
NSLog(@"MQTT session error: %@", error.localizedDescription);
}

◆ onMessagePublished

- (void) onMessagePublished

Called when a message has been successfully published to MQTT broker. This callback is invoked after a message (either position data or custom message) has been successfully sent to the MQTT broker.

Swift code snippet:

func onMessagePublished() {
print("Message published successfully")
}

Objective C code snippet:

NSLog(@"Message published successfully");
}

Member Data Documentation

◆ _locationManager

LocationManager MqttSessionExample._locationManager

Definition at line 10 of file mqtt_session_example.dart.

◆ _mqttSession

MqttSession MqttSessionExample._mqttSession

Definition at line 12 of file mqtt_session_example.dart.

◆ _mqttSessionListener

MqttSessionListener MqttSessionExample._mqttSessionListener

Definition at line 13 of file mqtt_session_example.dart.

◆ _navigationManager

NavigationManager MqttSessionExample._navigationManager

Definition at line 11 of file mqtt_session_example.dart.

◆ _sdk

NavigineSdk MqttSessionExample._sdk

Definition at line 9 of file mqtt_session_example.dart.

Property Documentation

◆ locationManager

NCLocationManager* MqttSessionExample.locationManager
readwritenonatomicstrong

Definition at line 15 of file MqttSessionExample.m.

◆ mqttSession

NCMqttSession* MqttSessionExample.mqttSession
readwritenonatomicstrong

Definition at line 17 of file MqttSessionExample.m.

◆ navigationManager

NCNavigationManager* MqttSessionExample.navigationManager
readwritenonatomicstrong

Definition at line 16 of file MqttSessionExample.m.

◆ sdk

NCNavigineSdk* MqttSessionExample.sdk
readwritenonatomicstrong

Definition at line 14 of file MqttSessionExample.m.


The documentation for this class was generated from the following files: