Reputation: 19
I have an issue delivering messages in chat when one of the users goes "offline". When 1-on-1 chat is initialized and two users are chatting, messages are being delivered and everything works great, but when app of one of the users goes background, the other one keeps messaging. It looks like messages are being sent, saved into history and cache (I log it), but when the other users goes back online and retrieves history — these messages do not appear.
In the logs I see them coming with the delay after the app restarts:
2013-03-13 01:14:42.983 MyApp[2314:1103]
QBChat/xmppStreamDidReceiveMessage:
<message xmlns="jabber:client" id="0" type="chat" from="[email protected]"
to="[email protected]">
<body>I try again</body>
<delay xmlns="urn:xmpp:delay" from="chat.quickblox.com" stamp="2013-03-13T07:58:14.455+0000">
Entire messaging process is built using code from SimpleSample chat (Also, I do not use Push Notifications yet).
Can you, please, advise me something on this issue?
Thank you.
UPDATE: After reinstalling the app, message history with the user isn't retrieved, that means, I guess, the history I was talking about was stored in cache. Seems like I have issues in retrieving history from server. I have tried 'message.delayed = 1' in 'ChatDidReceiveMessage', but it didn't help.
Upvotes: 0
Views: 1151
Reputation: 18346
You have to logout from Chat when you go to background and login again when you go to foreground.
Your messages will be received OK in this case
Upvotes: 1