XMPP Setup Guide

The XMPP Chat SDK is a module that enables XMPP chat for the popular Chat SDK for iOS Messaging Framework.
The Chat SDK provides:
  • User interface
  • Data persistence
The XMPP module then provides a network adapter that allows the Chat SDK UI to communicate with an XMPP server.


Since the XMPP project uses the standard Chat SDK UI, there is a lot of documentation available on the Github project pages:

Server setup

The XMPP Chat SDK supports currently supports ejabberd and OpenFire. It may also support other XMPP servers but they have not been tested.


First got to the ejabberd website and download the Community Version.
Follow the instructions on the ejabberd site to install ejabberd on your server.
Once the server is setup, you need to change some settings:
Enable registration
Change the ejabberd configuration conf/ejabberd.yml
allow: all
all: allow
search: true
matches: 10
allow_return_all: true
Start ejabberd by going to the installation directory on your server and running:
sudo sh bin/ejabberdctl start
You can check that ejabberd is up and running by logging in to the server admin:


Install OpenFire on your server or use a pre-installed OpenFire hosting service like the one offered by 1and1.
Once you've done that, go into the admin panel and enable in-band registration.
Then enable the search plugin.


Make sure you have the following modules enabled:
  1. 1.
  2. 2.
  3. 3.
  4. 4.
  5. 5.
  6. 6.
  7. 7.
  8. 8.

Client setup

The XMPP Chat SDK zip file contains everything you need to compile and run the project. However, a few steps are needed before you can compile the project.

iOS Setup

Use the terminal to navigate to the XcodeXMPPSwift folder. Then run pod update. This will install the project using Cocoapods.
Now open your app delegate and add the following code to setup the Chat SDK:
let config = BConfiguration.init();
config.googleMapsApiKey = "Google Maps Key"
config.loginUsernamePlaceholder = "JID"
// Set to true for non-https connections
config.xmppUseHTTP = true
config.logoImage = UIImage(named: "logo")
config.clientPushEnabled = true
// Set the domain and host address of the server
config.xmpp(withDomain: "domain", hostAddress: "host", port: 5222, resource: "iphone")
BChatSDK.initialize(config, app: application, options: launchOptions)

Android Setup

In your main application class setup the Chat SDK then configure the XMPP server:
// Configure the library
.setGoogleMaps("Your Google Maps Key")
// Add modules to handle file uploads, push notifications
.setXMPP("host", "domain")
.build().activate(this, "your-email-address");
Update the Android SDK and NDK locations in local.properties
Then run the app-xmpp target.

Google Maps

Follow the instructions here.
config.googleMapsApiKey = "Google Maps Key"

Push Notifications

By default, push notifications are handled by Firebase Cloud Messaging. For this to work, you will need to create a Firebase account, link the project to your Firebase account and then perform some configuration steps.
Go to this link and follow steps 1 - 7.
Go to this link and follow steps: 1 - 7.
Go to this link and follow steps 1 - 21.

File Upload

By default, the project uses Firebase Cloud Storage to store uploaded files. To do this follow the steps under Deploy the storage rules - here.