1
votes

Hey I am developing a private chat app on iOS in erlang using ejabberd. But I am not much aware of how to get started. I have installed erlang and ejabberd both on Macbook Pro and I will be deploying everything on Heroku. Here are few requirements:

  1. I want to minimize the use of erlang as I will be more comfortable to program backend in python, php, java. (but this is not a big issue. I will need tutorials).

  2. I wish to store messages in case if receiver is offline, I don't want any message to be missed. Also, I want a good authentication system.

    Please give me suggestions and i need some tutorials so that I can do what I wish to.

2
Its a lonely road.You wont get any tutorials for ejabberd.Ejabberd provides authentication which can be written in python,php etc.You dont need to code anything(ejabberd does most of the work for us).But in case there are certain specification that are beyond what ejabberd provides,you will have to extend ejabberd writing modules in erlang/otp.And yes ejabberd does provide with offline messaginf support.There is no option but to follow trial and error methodHIRA THAKUR
I think that you should consider xmpp framework for your IOS app development. you will only configure the ejabberd modules to your desired options, then interact with them using this library.Mazin Ibrahim

2 Answers

2
votes

I can answer your first question/requirement better than the second. I worked on a game -- a live fantasy draft app actually -- that was built using ejabberd. I think the key to minimizing erlang is to use ejabberd entirely as a transport layer. Instead of extending it, write a special administrative client to broker interactions in the "room". We called this the bot. In a given draft there was one bot and however many live participants. Then it was a simple matter of defining a message protocol that the bot and the clients understood. Some messages were game moves, some plain chat messages. The bot managed rules of play and data persistence, writing to a database.

Your next two questions (availability and authentication) are very broad. ejabberd does have some security built in but I don't know your needs. I'd address the availability via some sort of failover. Alternatively, you could use a queueing service such as Amazon SNS in front of your chat server but this would add both cost and complexity.

1
votes

If your load is moderate, you can custom ejabberd external authentication mechanism.

Protocol and example script is provided in ejabberd documentation: https://www.ejabberd.im/files/doc/dev.html#htoc9