Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use MQTT in iOS? [closed]

Tags:

ios

mqtt

Does anyone know if it is possible to use MQTT in iOS development like in Android? Is there a library or something?

like image 261
Nelia Avatar asked Jan 15 '12 11:01

Nelia


People also ask

Can you use MQTT without Internet?

Does MQTT require internet? Yes, to send or receive messages, the MQTT client must establish a TCP connection to the broker. However, MQTT comes with features specifically designed to cope with unstable network connections, like the broker buffering incoming messages for disconnected clients.

Does MQTT work on Bluetooth?

The communication between the sensor / device can be either via Wireless or Bluetooth. These mediums support MQTT-SN based sensors. You can easily connect your Sensor/Device to the Gateway via Bluetooth.

Can mobile app support MQTT?

For setting a mobile as an MQTT client, any MQTT supported app can be downloaded or a custom app that supports MQTT protocol can be created. There are many android apps available on the Google Play Store that can be used to make an android phone MQTT Client.

Is MQTT always connected?

MQTT uses a TCP/IP connection. This connection is normally left open by the client so that is can send and receive data at any time. If no data flows over an open connection for a certain time period then the client will generate a PINGREQ and expect to receive a PINGRESP from the broker.


1 Answers

Try this. It's much better than mosquitto: The Paho project provides open-source client implementations of open and standard messaging protocols aimed at new, existing, and emerging applications for Machine‑to‑Machine (M2M) and Internet of Things (IoT). The Paho MQTT C Client is a fully fledged MQTT client written in ANSI standard C. It avoids C++ in order to be as portable as possible. A C++ layer over this library is also available in Paho. In fact there are two C APIs. "Synchronous" and "asynchronous" for which the API calls start with MQTTClient and MQTTAsync respectively.

C - http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.c.git Wrapper - https://github.com/relayr/apple-mqtt-example

like image 68
treatheat Avatar answered Sep 22 '22 16:09

treatheat