MQTT client for iPhone

2019-02-03 19:40发布

I am trying to follow this blog for building push services for iPhone. The blog uses Android as the working platform,but it can be migrated to iPhone too, provided I get an MQTT client in objective C..which I cant find anywhere. The closest I got to this is :

  1. I got a C implementation here - libmosquitto

  2. This post says I can use something like an HTTP bridge.

Can anyone please help me exploit these two options ? I dont know the next step to take :(

Thanks !!

4条回答
劳资没心,怎么记你
2楼-- · 2019-02-03 19:44

For swift you can use the following library : https://github.com/ltg-uic/ios-mqtt-base

查看更多
虎瘦雄心在
3楼-- · 2019-02-03 19:52

The HTTP option would not help you in this case as you're not trying to talk to a JMS app via MQ (well - you haven't said that is your goal). Your best bet would be to compile something like libmosquitto or one of the other MQTT clients (see list at http://mqtt.org) for the iPhone. There's now a good example https://github.com/njh/marquette which uses mosquitto's libraries on iOS

查看更多
来,给爷笑一个
4楼-- · 2019-02-03 20:00

I'm not familiar with Objective C at all, but it seems as though you can compile any C code as Objective C. Would this get round your problem?

If you're using gcc, you can force it to compile as Objective C using "-x objective-c".

查看更多
时光不老,我们不散
5楼-- · 2019-02-03 20:02

I am currently using MQTTKit in my projects. It's fairly easy and straightforward to use.

查看更多
登录 后发表回答