简体   繁体   中英

XMPP One To One Chat in IOS

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".

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:

  1. mod_logdb
  2. Configuration guide

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM