flightonary / Moscapsule

MQTT Client for iOS written in Swift
MIT License
273 stars 69 forks source link

How do I subscribe to wildcard topics? #66

Closed JaceTan closed 6 years ago

JaceTan commented 6 years ago

I've successfully established the connection and I can simulate a chat sending messages back and forth on a specific topic (e.g. chat/room/1) between my iOS Simulator and Web Service.

However, I now want my iOS to subscribe using a wild card to chat/room/*, but it doesn't work as a wild card.

My code:

mqttClient.subscribe("chat/room/*", qos: 2)

To be clear, after my iOS Simulator subscribed to chat/room/*:

JaceTan commented 6 years ago

Nevermind, brainfart. I forgot some libraries use # as a wildcard character. # works.