Reputation: 9
I am getting "userid is nill" and sent message is not storing when switching to another viewcontroller. I want to implement XMPP One to One chat, how can I do this?
I have full project with me now but it is in nib files; my work is to convert that in to storyboards. I have done almost but I am getting stuck at XMPP.
What methods I have to use am getting stuck with some errors like "userid is nill".
Upvotes: 0
Views: 526
Reputation: 4414
As you mentioned in comment that you are using ejabberd XMPP server. There is a module mod_logdb which can store chat log to database.
Following is sample of configuration, just to have a look how you can configure mysql db to work with ejabberd.
{modules, [
{mod_logdb, [
{dbs, [
{mysql5, [
{user, "root"},
{password, "pass"},
{server, "serv"},
{port, 3306},
{db, "logdb"}
]},
{mnesia, []}
]},
{vhosts, [{"example1.org", mysql5}, {"example2.org", mnesia}{purge_older_days, 365},
{dolog_default, true},
{poll_users_settings, 5} ]},
%% Other modules ...
]}.
It will store all chat history/log to Database given in config file, from where you can read it as a normal MySQL query and pass to your application via webservice.
Reference Links:
Upvotes: 1