You should use the official client library: https://github.com/rabbitmq/rabbitmq-objc-client (Swift + ObjC compatible)
Basic Usage (extract from repo):
Instantiate an RMQConnection:
let delegate = RMQConnectionDelegateLogger() // implement RMQConnectionDelegate yourself to react to errors
let conn = RMQConnection(uri: "amqp://guest:guest@localhost:5672", delegate: delegate)
Connect:
conn.start()
Create a channel:
let ch = conn.createChannel()
Use the channel:
let q = ch.queue("myqueue")
q.subscribe({ m in
print("Received: \(String(data: m.body, encoding: String.Encoding.utf8))")
})
q.publish("foo".data(using: String.Encoding.utf8))
Close the connection when done:
conn.close()
Depending on the provider, you'll need to construct the connection URI manually. Heroku for example already presents it in it's dashboard. Here's the documentation on the supported parameters: https://www.rabbitmq.com/uri-spec.html and https://www.rabbitmq.com/uri-query-parameters.html
Example URI on Heroku:
amqp://xxxxxxx:yyy-zzz@aaaaaa.bigwig.lshift.net:10674/bbbbbbb
Format:
amqp_URI = "amqp://" [ username [ ":" password ] "@" ] host [ ":" port ] [ "/" vhost ] [ "?" query ]