All Projects → novastone-media → Mqtt Client Framework

novastone-media / Mqtt Client Framework

Licence: other
iOS, macOS, tvOS native ObjectiveC MQTT Client Framework

Programming Languages

objective c
16641 projects - #2 most used programming language
swift
15916 projects

Projects that are alternatives of or similar to Mqtt Client Framework

Mqtt Explorer
An all-round MQTT client that provides a structured topic overview
Stars: ✭ 1,162 (-32.52%)
Mutual labels:  mqtt, mqtt-client
Mqttandroidclient
Android消息推送MQTT
Stars: ✭ 131 (-92.39%)
Mutual labels:  mqtt, mqtt-client
Nyamuk
Python MQTT Client Library Based on libmosquitto
Stars: ✭ 72 (-95.82%)
Mutual labels:  mqtt, mqtt-client
Phpmqttclient
a mqtt client library for php
Stars: ✭ 33 (-98.08%)
Mutual labels:  mqtt, mqtt-client
Tuya Mqtt
Nodejs-Script to combine tuyaapi and openhab via mqtt
Stars: ✭ 105 (-93.9%)
Mutual labels:  mqtt, mqtt-client
Lua Mosquitto
Lua bindings to the libmosquitto MQTT client library.
Stars: ✭ 47 (-97.27%)
Mutual labels:  mqtt, mqtt-client
Mqtt
MQTT Client class
Stars: ✭ 86 (-95.01%)
Mutual labels:  mqtt, mqtt-client
Mosquitto Php
A wrapper for the Eclipse Mosquitto™ MQTT client library for PHP.
Stars: ✭ 448 (-73.98%)
Mutual labels:  mqtt, mqtt-client
Ntex Mqtt
MQTT Client/Server framework for v5 and v3.1.1 protocols
Stars: ✭ 95 (-94.48%)
Mutual labels:  mqtt, mqtt-client
Psmqtt
Utility reporting system health and status via MQTT
Stars: ✭ 95 (-94.48%)
Mutual labels:  mqtt, mqtt-client
Paho.mqttdotnet
A .Net wrapper for eclipse/paho.mqtt.c
Stars: ✭ 33 (-98.08%)
Mutual labels:  mqtt, mqtt-client
Paho.mqtt.java
Eclipse Paho Java MQTT client library. Paho is an Eclipse IoT project.
Stars: ✭ 1,620 (-5.92%)
Mutual labels:  mqtt, mqtt-client
Mqttx
MQTT X - Elegant MQTT 5.0 Client Tool of Cross-platform
Stars: ✭ 892 (-48.2%)
Mutual labels:  mqtt, mqtt-client
Luamqtt
luamqtt - Pure-lua MQTT v3.1.1 and v5.0 client
Stars: ✭ 58 (-96.63%)
Mutual labels:  mqtt, mqtt-client
Hbmqtt
MQTT client/broker using Python asynchronous I/O
Stars: ✭ 667 (-61.27%)
Mutual labels:  mqtt, mqtt-client
Mqtt
🕹 MQTT Protocol Analysis and Coroutine Client for PHP. Support for 3.1, 3.1.1 and 5.0 versions of the MQTT protocol.
Stars: ✭ 72 (-95.82%)
Mutual labels:  mqtt, mqtt-client
Qmqtt
MQTT Client for Qt
Stars: ✭ 409 (-76.25%)
Mutual labels:  mqtt, mqtt-client
Adafruit mqtt library
Arduino library for MQTT support
Stars: ✭ 441 (-74.39%)
Mutual labels:  mqtt, mqtt-client
Client
An MQTT client written in and for PHP.
Stars: ✭ 90 (-94.77%)
Mutual labels:  mqtt, mqtt-client
Applozic Ios Sdk
iOS Real Time Chat & Messaging SDK
Stars: ✭ 104 (-93.96%)
Mutual labels:  mqtt, mqtt-client

MQTT-Client-Framework

Build Status codecov CocoaPods Version Platform BrowserStack Status

MQTT-Client-Framework is a native Objective-C iOS library. It uses CFNetwork for networking and CoreData for persistence. It is a complete implementation of MQTT 3.1.1 and supports TLS.

You can read introduction to learn more about framework.

MQTT-Client-Framework is tested with a long list of brokers:

  • mosquitto
  • paho
  • rabbitmq
  • hivemq
  • rsmb
  • mosca
  • vernemq
  • emqtt
  • moquette
  • ActiveMQ
  • Apollo
  • CloudMQTT
  • aws
  • hbmqtt (MQTTv311 only, limitations)
  • aedes
  • flespi

Usage

For example app, see MQTTChat

Create a new client and connect to a broker:

#import "MQTTClient.h"

MQTTCFSocketTransport *transport = [[MQTTCFSocketTransport alloc] init];
transport.host = @"test.mosquitto.org";
transport.port = 1883;
    
MQTTSession *session = [[MQTTSession alloc] init];
session.transport = transport;
[session connectWithConnectHandler:^(NSError *error) {
	// Do some work
}];

Subscribe to a topic:

[session subscribeToTopic:@"example/#" atLevel:MQTTQosLevelExactlyOnce subscribeHandler:^(NSError *error, NSArray<NSNumber *> *gQoss) {
    if (error) {
        NSLog(@"Subscription failed %@", error.localizedDescription);
    } else {
        NSLog(@"Subscription sucessfull! Granted Qos: %@", gQoss);
    }
 }];

In your MQTTSession delegate, add the following to receive messages for the subscribed topics:

- (void)newMessage:(MQTTSession *)session data:(NSData *)data onTopic:(NSString *)topic qos:(MQTTQosLevel)qos retained:(BOOL)retained mid:(unsigned int)mid {
    // New message received in topic
}

Publish a message to a topic:

[session publishData:someData onTopic:@"example/#" retain:NO qos:MQTTQosLevelAtMostOnce publishHandler:^(NSError *error) {
}];

If you already have a self signed URL from broker like AWS IoT endpoint, use the url property of MQTTWebsocketTransport:

MQTTWebsocketTransport *transport = [[MQTTWebsocketTransport alloc] init];
transport.url = @"wss://aws.iot-amazonaws.com/mqtt?expiry='2018-05-01T23:12:32.950Z'"

MQTTSession *session = [[MQTTSession alloc] init];
session.transport = transport;
[session connectWithConnectHandler:^(NSError *error) {
    // Do some work
}];

Installation

CocoaPods

Add this to your Podfile:

pod 'MQTTClient'

which is a short for:

pod 'MQTTClient/Min'
pod 'MQTTClient/Manager'

The Manager subspec includes the MQTTSessionManager class.

If you want to use MQTT over Websockets:

pod 'MQTTClient/Websocket'

If you want to do your logging with CocoaLumberjack (recommended):

pod 'MQTTClient/MinL'
pod 'MQTTClient/ManagerL'
pod 'MQTTClient/WebsocketL'

Carthage

In your Cartfile:

github "novastone-media/MQTT-Client-Framework"

Manually

Git submodule

  1. Add MQTT-Client-Framework as a git submodule into your top-level project directory or simply copy whole folder
  2. Find MQTTClient.xcodeproj and drag it into the file navigator of your app project.
  3. In Xcode, navigate to the target configuration window by clicking on the blue project icon, and selecting the application target under the "Targets" heading in the sidebar.
  4. Under "General" panel go to "Linked Frameworks and Libraries" and add MQTTClient.framework

Framework

  1. Download MQTT-Client-Framework
  2. Build it and you should find MQTTClient.framework under "Products" group.
  3. Right click on it and select "Show in Finder" option.
  4. Just drag and drop MQTTClient.framework to your project

Security Disclosure

If you believe you have identified a security vulnerability with MQTT-Client-Framework, please report it to [email protected] and do not post it to a public issue tracker.

Thanks

This project was originally written by Christoph Krey.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].