ios - Get Offline Messages From XMPP Without Becoming Online -


we using ejabberd server our mobile chat application. , using ios xmpp-framework our ios application ( https://github.com/robbiehanson/xmppframework)

but have problem on implementation couldn't find solution. we've implemented every aspect of xmpp messaging , works besides 1 thing:

while our application on background, our ejabberd server sends push notifications inform offline messages. (only sends notification offline messages)

then we've decided implement ios background push notification functionality offline messages while application on background.

but problem have become online(send presence) in order offline messages. when creates 2 unwanted consequences:

  1. the party sends message saw our presence online (even though in background)
  2. just because becoming online while application on background , our server cannot send push notification other people's messages becuase online , server can send notification offline messages.

for solving problem, thing can think of is, if there way retrieve offline messages xmpp server without becoming online. know if there way xmpp-framework ios

[edit] let me clarify issue little bit more:

problems more one:

problem 1 - push notification problem:

1.1 - server check if message sending online or offline user. if user offline server sends push notification inform user if user online server doesnt send anything.  1.2 - when application in background , receive notification offline messages, application become alive(still in background) , become online in order offline messages 1.3 - because client became online, server doesnt send push notifications anymore application still in background user cannot informed message he/she received. 

so in order fix problem need find way receive offline messages not sending online presence server

problem 2 - message receive problem

2.1 - server check if message sending online or offline user. if user offline server sends push notification inform user if user online server doesnt send anything.  2.2 - when application in background , receive notification offline messages, application become alive(still in background) , become online in order offline messages 2.3 - when application became online server sends offline messages client doesnt send total count of offline messages(at least cannot ios xmppframework) 2.4 - dont know how longer client should stay alive in background because dont know total count of offline messages, after getting 2-3 messages have suspend application in background. in case there might buggy situations such xmpp framework receive offline message suspend client application before writing database etc... 

in order find solution problems:

  1. i need find way 1 offline message when want server
  2. if possible need offline messages without becoming online

look ejabberd_mod_offline_post

  1. first config room must member-only room, , add users members right after created it, able total.
  2. add above module ejabberd modules.
  3. implement callback service handle callback post.

the idea when user go offline:

  • in one-to-one case, offline_message_hook raised
  • in muc case, muc_filter_message raised, , 1 not presence-available offline.

[edited]:

i using on 16.06. , there error in source code @ lines:

...  body = xml:get_path_s(stanza, [{elem, list_to_binary("body")}, cdata]),  ...   type = xml:get_tag_attr_s(list_to_binary("type"), packet),   body = xml:get_path_s(packet, [{elem, list_to_binary("body")}, cdata]),  ... 

i fixed them adding f xml:, e.g. body = fxml:get_path_s(stanza, [{elem, list_to_binary("body")}, cdata]),

and muc, offline users in 'offline' field format, 'user1..user2..user3..', need split them out string.


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -