XMPP using OpenFire in iOS - ios

How can we use XMPP and Openfire to send files to another iOS devices which are on different networks.
I have developed the source code that is working on same network to send the files but the same code is not working to send the files to different network.
Let me know if you have any solutions for these issues.

Related

Unity Chat application

i am currently working on a real-time chat app in Unity
and i found those platforms to work with,
Firebase : Can we send Videos efficiently ??
MatriX : https://www.ag-software.net/matrix-xmpp-sdk/
but i am not sure that we can send videos with MatriX ?
i wanted to know from your experience
what is the best way to make real-time chatting (support photos and videos sending) in Unity ?
thanks in advance
You need to find or create services where your clients can connect and:
upload files (photos, videos .etc) and get an public and downloadable URL.
send messages to other connected clients that apart from the string, also contain media metadata (.eg a list of file attachments which are actually URLs uploaded at service (1))
Now, if you cannot find a single service that supports those two then you could try to find two different ones.
here is an example of a chat console application in C#. It contains a web service and client library that is used by the console app. Instead of a console app, it could be used in a Unity app. It does not support file uploading but it can send messages between clients over web sockets.
If you were to create something yourself, instead of finding a 3rd party service, I would recommend node.js/express and socket.io for a server since its quite beginner friendly.
here is a C# client library that can listen to socket.io events from the server. It must be the same that is used in the console application I shared above.

Socket.io vs xmpp for a mobile chat app

I have to build a realtime chat app in iOS, which can later also have voice and video calling. I want to use a scalable and light weight solution integrated with the backend, making sure that the solution also supports calling in the future.
I'm not too sure if socket.io supports voice and video calls; Should I use that or xmpp? Or any other similar solution?
As it was written above socket.io is a chat server implementation using Websockets, while XMPP is a protocol.
I'd recommend using an XMPP chat server in this case.
For audio/video calls implementation you will need to implement signaling via XMPP to establish connection between the devices before the call.
Also for audio/video chat implementation you will need STUN/TURN/ICE server and you will need to add client-side implementation for passing media streams from peer-to-peer if you choose WebRTC peer-to-peer option.
There is an easier way as well. You can use a ready XMPP based server and SDK to build your app. For example, ConnectyCube provides such service.
They have a ready backend and SDKs you can use for building chat and audio/video chat apps. Also they already have a TURN server, so you do not need to worry about this part too.

How to achieve file sharing through xmpp in ios

I am working on a chat application through xmpp i have done one to one and MultiUser Chat. So please tell me how to do file sharing in XMPP.

Enable BOSH services in XMPP IOS framework (XMPPFramework) to create chat based app

I have implemented Chat based application. I can able to do many functionality with https://github.com/robbiehanson/XMPPFramework library. It is very good library. But after some days my server side guys included bash services in server. My server side guys implementing xmpp using Strophe.js. And they are using following code to enable BOSH service while connecting.
BOSH_SERVICE = "http://host.com:5280/http-bind";
new Strophe.Connection(BOSH_SERVICE);
Now they told me enable BASH service in IOS side also. Now I can not connect to that server.
How to include BOSH service in robbiehanson xmpp IOS library (https://github.com/robbiehanson/XMPPFramework)?
The iOS xmppFramework does not currently offer support for BOSH. Here's a confirmation:
https://github.com/robbiehanson/XMPPFramework/issues/6#issuecomment-54085037
But, your iOS client can still login to the server via the socket connection and your web client can use BOSH. That's your alternative and it should work well.
If you really want to create your own iOS BOSH implementation, look into XMPPTransports as a starting point.
Happy coding :)

How to broadcast bluetooth service in ios using corebluetooth?

If I want to have my iOS device act as a "server" and broadcast its bluetooth services to other iOS devices, how would I use the core-bluetooth framework (or any other iOS framework) to implement this? So far, all I've seen from the corebluetooth framework is how to write the client-side of things. (Scanning, connecting to existing bluetooth services)
You can make use of the OSX sample project called DNSSDObjects. The core classes (three of them) work just fine under iOS. The code requires a few small changes to work with Bluetooth (as-is they only work with WiFi). See my answer to another question for the required code changes.
Basically you use whatever code you need to setup your server and begin accepting socket connections. You then use the DNSSDRegistration class to advertise your server via Bonjour.
The other two classes, DNSSDBrowser and DNSSDService can be used by iOS client code to find the server, or any app or program that can find Bonjour services will also be able to find your server.
There are two great WWDC video that show how to act as either the client or the server using an appropriate iOS device. They can be found here, you're looking for sessions 703 and 705.
Downloads of the source that they use can be found here. You'll need a developer account (free works) to login and view/download.

Resources