How to make connexion between swifty iOS client and RABBIT MQ - ios

i'm developing a small mobile app and i want to receive notifications push from RABBITmMQ, but the problem i don't know how to connect my swift iOS client with RABBITMQ, by the way RABBITMQ is not installed at my local host
i have some credentials configuration to implement it. the problem is the documentation of RABBIT MQ not mentioned how to connect to this remote host not the local.

To connect RabbitMQ to ios you can use this lib:
https://github.com/rabbitmq/rabbitmq-objc-client
About remote connection, follow this example:
https://www.rabbitmq.com/tutorials/tutorial-one-swift.html
here the code:
let conn = RMQConnection(uri: "amqp://user:pass#myrabbitserver.com:5672",
delegate: RMQConnectionDelegateLogger())

Related

Run gRPC server on iOS

Is it possible to run a gRPC server on iOS?
Let’s say we want to use the gRPC framework to define APIs etc. And now we want to deploy a gRPC server in the same process with the application using it — connection via an InprocessChannel.
Is there a gRPC port for iOS that allows to do that?
Yes, unlike with the Objective-C bindings for gRPC, it's possible to run a gRPC server on iOS using Swift GRPC:
APIs and generated code is provided for both gRPC clients and servers,
and can be built either with Xcode or the Swift Package Manager.
Support is provided for all four gRPC API styles (Unary, Server
Streaming, Client Streaming, and Bidirectional Streaming) and
connections can be made either over secure (TLS) or insecure channels.
The Echo example contains a Mac app that demonstrates both server and client code. The Swift gRPC parts should be similar in an iOS app.
It is not officially supported by gRPC, but you have a couple of options to do this on your own:
You can wrap gRPC C++ and use their server feature. Someone tried this before and seems worked.
You can use the gRPC Swift repo which has gRPC server feature on iOS client.

Not Able To Connect to XMPP Server on other server

Not Able To Connect to XMPP Server Outside the Network (different netwok or WiFi)
Hi all am developing an IOS app which has chat feature am able to connect to XMPP server(Ejabbered) which is installed locally (same wifi for Local mac and device) but when am trying to connect to server which is installed on main live Server its not connecting because thats a different network! how i solve this issue!
Thanks in Advance!

Socket connection with different ports

I'm trying to run a socket connection from my iOS app to a bespoke server.
The iOS communicates via UDP to the server on port 12345. The request needs to come from socket 54321 on the device.
How do I open up a socket connection on iOS that communicates to a server on one port but listens via a different port.
I have followed the example on:
https://www.raywenderlich.com/3932/networking-tutorial-for-ios-how-to-create-a-socket-based-iphone-app-and-server
But this does not cover the local port
I have also looked at the documentation on https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/NetworkingTopics/Articles/UsingSocketsandSocketStreams.html but I am finding it unclear due to my limited knowledge of socket connections.
I am currently attempting to use https://github.com/robbiehanson/CocoaAsyncSocket/wiki/Reference_GCDAsyncSocket
But I don't seem to be able to control the local port.
Thanks in advance
Normally you don't care about the sending socket, but when you create your AsyncUDPSocket you can use bindToPort: to set its port. Then use sendData:toHost:port:timeout:tag: to send the data

To connect with AWS IoT broker in iOS

We are developing an application which needs to consume AWS IoT service based on a MQTT protocol deviation. We are currently facing issues to get connected with MQTT broker provided by AWS IoT cloud server.
Following is the environment:
iOS Version: 8.0 / 9.0
Programming language: Swift
Library for MQTT: Moscapsule
Steps followed:
Set initial config clientid, host, port
Set client certificate with private key, providing .pem file path (e.g. cert.pem, privateKey.pem)
Set server certificate which is root certificate .pem file path (e.g. rootCA.pem)
Set tls opts with tsl_insecure: false, cert_reqs: SSL_VERIFY_PEER, tls version: tlsv1.2, ciphers: nil
Problems faced:
When trying to connect to server/broker gives error “unable to create TLS_Context”.
With setting tls cert_reqs: SSL_VERIFY_NONE, gives connection status success with subcribe and publish sucess, but doesn’t reflect on server or broker.
Any help in this context is highly appreciable.
The AWS SDK for iOS already supports connecting to AWS IoT over MQTT. You can see an example Swift program which transfers data to and from AWS IoT over MQTT using certificate-based authentication here. If you'd like to use a different MQTT client and just need to know how to set it up, you might start with the AWS SDK for iOS, and then have a look at the code involved in setting up the TLS connection.
Thanks for using AWS IoT.

Connecting to Java Server from iPhone Chat application using Socket

One of my iOS developer is trying to connect to my Chat Application server which is developed using Socket (Java).
When he tries to connect to Server using GCDAsyncSocket during debug I can see readStreamHeader() is executing which is throwing StreamCorruptedException.
Same thing is happening when I do telnet using cmd : telnet localhost 13000
I'm able to connect with my java created client application but not with iOS client. I believe socket in java and in iOS have different way of communication. Please HELP !

Resources