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

Public Member Functions

(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.
 

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

◆ 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");
}

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: