an Objective-C native MQTT Framework http://mqtt.org
- mosquitto
- paho
- rabbitmq
- hivemq
- rsmb
- mosca
- vernemq
- emqtt
Add MQTTClient.framework from the dist directory to your IOS project or use the CocoaPod MQTTClient
Create a new client and connect to a broker:
MQTTSession *session = [[MQTTSession alloc]initWithClientId:@"<client_id>"]
// Set delegate appropriately to receive various events
// See MQTTSession.h for information on various handlers
// you can subscribe to.
[session setDelegate:self];
[session connectAndWaitToHost:@"<host>" port:1883 usingSSL:NO];
Subscribe to a topic:
[session subscribeToTopic:topic atLevel:MQTTQosLevelAtLeastOnce];
Publish a message to a topic:
[session publishAndWaitData:<your data here>
onTopic:@"<topic here>"
retain:NO
qos:MQTTQosLevelAtLeastOnce]
Copyright (C) 2013-2015 Christoph Krey
Based on and fully API backward compatible with
https://github.com/m2mIO/mqttIO-objC
Copyright © 2011, 2013 2lemetry, LLC
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Framework build using instructions and scripts by Jeff Verkoeyen https://github.com/jverkoey/iOS-Framework
Documentation generated with doxygen http://doxygen.org
Wrapper | --- | ---- | MQTTKit | Marquette | Moscapsule | Musqueteer | MQTT-Client | MqttSDK | CocoaMQTT |
---|---|---|---|---|---|---|---|---|---|
Obj-C | Obj-C | Swift | Obj-C | Obj-C | Obj-C | Swift | |||
Library | IBM | Paho | Mosquitto | Mosquitto | Mosquitto | Mosquitto | native | native | native |