I have created a chat application using openfire server and used Smack Api.Its all working fine,now i need to retreive the chat history from openfire server.
I have installed Monitoring Plugin to archive the chat.
In above screenshot, I can able to see the chat history for both one to one chat and group chat.
Now i need to get the chat history through app programmatically.I have referred many articles and post but did not find a solution.
If anyone know please tell your suggestions.
Thanks in advance.
Possible duplicate question.
If you have installed the monitoring plugin, you can read in its readme file under the configuration paragraph the following content:
Chat archiving is enabled by default. However, only information about who is communicating and at what time is stored unless chat transcript archiving is enabled. To enable chat transcript archiving or group chat archiving, you will need to log into the admin console and go to:
Server --> Archiving --> Archiving Settings
Thereafter the messages get stored in your external database table 'ofMessageArchive'.
This history can be further fetched from the database.
the XEP (XMPP Extension Protocol) that discuss about this is the XEP-0313.
There are some open issues in Openfire backlog to acomplish this XEP.
So, I suppose that ins't possible yet :(
Good luck!
Related
Have 2 apps on separate devices: Rider & Driver.
Let's say, the Driver needs to contact the Rider via messaging, or vice versa, is there a way to do it without using the stocked message app to protect privacy?
My idea was to create on both apps an empty box, add a text view for the message and send button and add the msgs to firebase db. Unfortunately, i am not sure how i would do it in Android as well as the response.
Any suggestions or how to's would be greatly appreciated.
You could probably integrate your app with Firebase.
For simple messaging, you could use Firebase Cloud Firestore to do it and for notification, you can use Firebase Cloud Messaging.
Messaging
You can have a sub-collection to store all the chats between the rider and driver in the form of documents. 1 chat will be a document storing the info such as time, sender, as well as message.
Notification
From the doc:
Send acknowledgments, chats, and other messages from devices back to
your server over FCM’s reliable and battery-efficient connection
channel.
You could start research from Firebase sample application.
Highly recommend you go through this third party tutorial: Firebase Tutorial: Real-time Chat to get some idea, it's in iOS but the concept is the same.
Yes, there is a way to do it.
Actually you can use any messaging platform, e.g. Firebase, ConnectyCube, Twillio, Layer etc.
All of them provide API & SDK for iOS, Android and Web for chat so you can easily do it using it.
I used ConnectyCube some time ago, it can be done in the following way:
Initialize app
Sign Up user
Connect to chat
Create a chat dialog with other user
Send/Receive messages
More detailed chat code sample for Android can be found here
Most of the above platforms provide a cloud hosted plan, but some of them also provide an Enterprise plan when you the whole platform can be installed at your AWS/Google/Azure account, so hence the privacy is the best because you own all your data
We are building a real-time mobile to web text & image chat application using Firebase. Consumers can send messages to 10 categories for example, TV Help, Computer Help, Camera Help etc from an android mobile app. Agents will receive messages on an AngularJS web app where they can reply. Now, one category can have many agents under it.
For example, if ConsumerA sends a message to "Camera Help", the messages should be routed to AgentA & AgentB, if they are handling "Camera Help". Any of them can reply to the consumer.
What is the best way to structure a firebase database for this use case?
Also, we would like to send consumers android push notifications if the app is not in use. I have heard you can use a firebase queue, but it seems challenging, are there any examples of this?
Thanks
Well if I am to design your firebase it would be like,
Customer_name
Customer_number
Customer_address...and other customer related data
Category_of_item
Message
Time and date of message
The part of using firebase for push notifications is concerned, then there is no direct support for that in firebase I would suggest you to go for parse or GCM. Cheers :)
I'm developing simple chat application, in which I have done chat functionality, means my app user can send and receive chat messages at both end.
But now I want to get chat history of same user, how can I do that? I have tried various things and also done lots of R & D but I don't get required information.
I'm using asamck lib, and openfire server. I added monitoring service plugins on my server, but what is next step to get the history?
Recently, I try to build a chat app in android with XMPP! I installed Ejabberd, and with connection, I can chat with another user with my android app! But now, I have an issue in retrieve chat logs history! I mean that I don't know how to get chat history with Asmack and Ejabberd. I tried reading the smack document, however, I can find nothing!! So, anyone has any suggestion to get chat history with asmack and Ejabberd? Thank very much!
Ejabberd does not necessarily save chat history by default, since that can be a potentially very expensive task. Nor is it built into the core part of the server. There are modules available such as mod_archive that can installed/enabled that would allow you to save some chat history, but as chat history is not part of the core XMPP spec, there is no "standard" way to do it, so it would only work when connecting to your own servers. What you might consider doing instead is archiving your chat history yourself locally. You will notice that this is what most desktop XMPP clients do. Enabling mod_offline would allow you to receive message that were sent to you when you were offline. But there is no special method for retrieving them, they just arrive when you log in.
I want to push new data to the apps on user's device after a couple of days, like news update service. It's NOT APK update. Where do I get some clues to start with? tks in advance
(sorry if this question is dumb, but why can't I search for it on stackoverflow, I must miss something?).
You can accomplish this in many different ways. One option is to design your app to periodically query a server-side REST API and download new information in an JSON/XML format. That information can be stored in a local SQLite or flat file database on the device. You could also integrate with Google's Cloud Messaging service to send push notifications to the device. When your application receives a push message it could spawn a new background process to download any updated content from your server.
You can use push notification (search for c2dm) which will notify users whenever, content/data is updated on server. Whenever, android application will receive push message from server, it will update the local database (say, news database in your case) from server.
Hope it is helpful information for you.
Just upload the new app, with the same key that you used it previously and also increment the version code.