Instant messaging apps like Whatsapp, Kik Messenger, and Snapchat are hot right now and there are some existing instant messaging protocols that could be used to build your own Delphi XE6 Firemonkey instant messaging app. The XMPP (formerly Jabber) protocol is an open instant messaging protocol. There are various client components out there in Delphi for Windows using the VCL but I was unable to find one that would work on mobile. On the server side there are various open source XMPP servers but the one I found that seems really good is called OpenFire. The OpenFire server runs on Windows and Linux (and probably others as it is built in Java). There are various different plugins available for it including an HTTP REST API which allows you to make HTTP requests to the admin side to control actions like adding new users, friending users, and more. I hired an expert developer on oDesk to create a XMPP component to run cross platform on Android, IOS, Windows, and OSX in Delphi XE6 Firemonkey. The developer build a working instant message demo client and a working XMPP protocol component with Firemonkey and I am making them available. It does use the OXML library for Delphi which is also cross platform to handle the XML protocol that XMPP is based on. Sockets are handled by the Indy component suite. The demo client runs on Windows, Mac, IOS, and Android and should compile without too much trouble in Delphi XE5, Delphi XE6, and AppMethod. I have not tested the component or demo on any other server besides OpenFire.
Thanks a lot. Looking for it in a long time.
hi, i need help for this Source code,
i installed on my device, but i can receive the message conversation, somebody help me, i need this…..
Does it work on Win32 for you? Debug and get it working on Win32 and then try on your device. IOS or Android?
on win32 i can receive a message, but when i run it on android i can not receive a message yet, is there any something wrong?i use IP address not hostname/domain name.
Did you enable the internet access permission on the Android app?
Well, i don’t found a total free xmpp component to VCL. Them I cheged your code from fmx to VCL and works well. But i woud like to create a user and i dont see the method to do this. Do you know how i can do this?
I used the User Service plugin for OpenFire. Basically it exposes user management via a HTTP service. My app talks to my web server. My web server administers users via the HTTP service. http://www.igniterealtime.org/projects/openfire/plugins.jsp
I have to change from fmx to VCL too, but its not ok. May I have your change code ?
Sure, do whatever with it. However, there are lots of VCL ones that are better. Delphi even comes with one from IP*Works.
Awesome tutorial ! Very nice.
Is there any example on multi person chat / chat room ?
thank you.
i try use FiremonkeyXMPPClient, and i run application it ok.
but i click “CONNECT” error TJabberSocket.Initialize.
help me please……..
What platform? Are your internet permissions set?
I use the platform: PC Windows 8 and Delphi XE6
and I also use OpenFire and MySQL
I set permissions internet on files AndroidManifest.template.xml as follows: “”
In addition:
on my Delphi code sets:
1.
procedure TFormConnect.FormCreate(Sender: TObject);
begin
GJabberClient.JabberServer := ‘localhost’; // put your server domain in here
GJabberClient.JabberPort := 5222;
GJabberClient.OnLogged := OnLoggedProc;
GJabberClient.OnGettingContacts := OnGettingContactsProc;
end;
2.
procedure TFormConnect.btnConnectClick(Sender: TObject);
begin
GJabberClient.Login := edUsername.Text;
GJabberClient.Password := edPassword.Text;
GJabberClient.JResource := ‘openfire’; //
GJabberClient.InitializeSocket;
if not GJabberClient.Connected then
begin
Showmessage(‘Cannot connect to server !’);
Exit;
end;
GJabberClient.DoLogon;;
end;
Hi, First thanks a lot for your software.
I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.
I try to use test application FMXJabber on Win32 (delphi XE7)
but always the same error ocurred: Authentification failed !!
Thanks in advanced.
Did you set JabberServer yet? See frmConnect, line 64:
GJabberClient.JabberServer := ”; // put your server domain in here
thanks for the info and the response
I have set: GJabberClient.JabberServer: = ‘192.168.1.11’
1. If I use Target Platform (Android), and I click connect appeared error “Error # 111 socket Connection refused”
2. But if the target platform (win 32) and I click connect successfully.
a. but if i send a message, the message does not get to the destination
b. but if i receive messages okay and succes
I did not try to use it on mobile device(s) yet (Going to) but from my tests to run Windows clients and server on separate computers I found that using IP address won’t work but using computer’s name of the server will. I would suggest you to do so, plus to allow connection to TCP port 5222 on the server computer’s firewall setup. Hopefully this helps.
Hi, First thanks a lot for your software.
I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.
I try to use test application FMXJabber on Win32 (delphi XE7)
but always the same error ocurred: Authentification failed !!
Thanks in advanced.
Hi, First thanks a lot for your software.
I have a openfire server, on a windows server in Amazon, and connect with Spark (on my computer) without problem.
I try to use test application FMXJabber on Win32 (delphi XE7)
but always the same error ocurred: Authentification failed !!
Thanks in advanced.
I have same Error.
In C# xmppClient case, ‘JabberClient’ class have ‘PlaintextAuth’ property.
set PlaintextAuth = true;
it works well
but I can’t find that property at the fmx xmppclient.
i was tried it with DelphiXE7 with Windows and on android Tablet.
i want connect to Nimbuz. when i click connect button its nothing to do..
Why ? its cant connect Nimbuuz? what should i do for connect nimbuzz ?
https://stackoverflow.com/questions/9742016/connecting-to-nimbuzz-chat-with-opensource-xmpp-library
Hello!I have a question.
How does use SSL in this Instant Messaging Demo Client ?
You’d probably have to add that functionality. It wasn’t one of our goals when I had it built.
OK. Thanks
Hi, Admin
I try to use this example project with openfire server.
I use xe7 Delphi in Windows and Android platform.
I’m be able to login/send/recive message from my xmmp client delphi and another client(es spark), but when I send administrative message from openfire console, Delphi demo not woking correctly and not recive message.
Thank you for help me.
Maybe an admin message is a different kind of message and you’ll have to add code to handle it.
Hi, Admin
I’ve tried to use the project in Android, but it is not working, when I enter the username and password and press the button connect, nothing happens and if I press it again, comes out with the exception:
[TJabberClient.Initialize]:
[TJabberSocket.Initialize]: Already connected.
I tried to use the hostname as the IP from the server machine.
On Windows It works when I set the hostname as the name of the server, however if I use the IP from the server, the same happen as Android, the exception showed up.
Any help would be appreciate, I need this quick.
This is because when you installed openfire left the default server name. Change the server name to the ip and retest.
i have the same problem with a openfire server the name no is the problem
Hi, Admin!
Thank you very much for this smart solution!
It works very well!
I wonder if anyone has implemented the chat room resource. I mean, create, delete, join chat rooms etc.
I think this will nice, because you could send messages to a group of friends, for example.
Best regards
Hello!
I found the answer here: http://oriolrius.cat/blog/wp-content/uploads/2009/10/Oreilly.XMPP.The.Definitive.Guide.May.2009.pdf
Thank you
Hello! enjoyed this example, I have a cloud server running openfire. Making the compilation of this example for windows everything works fine, I can receive and send mesagens, however when compiling for android can only send and can not receive anything.
What change can I do to fix this ??
Thanks in advance.
That is an odd one. Not sure what the fix for that would be. Use the debugger to track it down would be my only suggestion so far.
estou tendo problemas quando tento instalar ele no ex 10 berlin, sabe como posso resolver?
alguém tem alguma documentação desse objeto?