smack

File transfer using smack in android apps.

早过忘川 提交于 2019-12-03 00:34:00
This error come in log. from='kutbi1@360degree/Smack' to='akash@360degree/Smack' type='error' id='hK1L6-5'> <si xmlns='http://jabber.org/protocol/si' id='jsi_191216212994140179' mime-type='image/png' profile='http://jabber.org/protocol/si/profile/file-transfer'> <file xmlns='http://jabber.org/protocol/si/profile/file-transfer' name='this_old_house.png' size='12623'> <desc>You won&apos;t believe this!</desc></file> <feature xmlns='http://jabber.org/protocol/feature-neg'> <x xmlns='jabber:x:data' type='form'><field var='stream-method' type='list-multi'> <option><value>http://jabber.org/protocol

How to get timestamp of incoming xmpp message?

纵然是瞬间 提交于 2019-12-02 20:44:33
I am using aSmack library to communicate with remote xmpp server. I am able to send/receive messages, but I want to get timestamp of incoming message. Could you tell me please, is it possible at all? Because I can't find anything about this question. Thanks in advance Timestamp is not part of the regular messages. Therefore you cannot extract it. There is a spec (as mentioned by @Dmitry), but this only applies to specific types of messages. Typically those that are NOT realtime, such as offline and publishing the last pubsub message of a node when a new subscription is created. These are

How can i listen incoming subscription request in smack openfire android

一曲冷凌霜 提交于 2019-12-02 19:02:55
问题 I am creating an android chat application using smack openfire.The problem that i am facing is i know how to send and accept subscription request but how can i know if i have received any subscription request. I have used Stanza listener but the listner is only listening to incoming chat messages not subscription request. Below is my code StanzaFilter filter=new StanzaTypeFilter(Message.class); PacketCollector collector=connection.createPacketCollector(filter); connection

Openfire Android PubSub Subscription request aproval

烂漫一生 提交于 2019-12-02 15:08:53
问题 I am new to Openfire and smack, therefore I have questions regarding pubsub feature. Actually, I have created a node with setAccessModel as authorize , shown below. PubSubManager mgr = new PubSubManager(xmpp.getConnection()); try { LeafNode leaf = mgr.createNode("testNode"); ConfigureForm form = new ConfigureForm(DataForm.Type.submit); form.setAccessModel(AccessModel.authorize); form.setDeliverPayloads(true); form.setNotifyRetract(true); form.setPersistentItems(true); form.setPublishModel

'remote-server-timeout' exception as I try to connect to the server

99封情书 提交于 2019-12-02 12:44:19
While trying to connect to openfire server through the following code : Connection connection = new XMPPConnection("https://192.168.0.101:5222"); connection.connect(); I get an exception which says : https://192.168.0.101:5222:5222 Exception: Could not connect to https://192.168.0.101:5222:5222.; : remote-server-timeout(504) What could be the reason for this ? Note : I have allowed openfire fire server through the firewall.I also tried putting off the firewall, but the same result.Server is my own machine. The same machine on which I am trying to run the program. You can use Connection

How can i listen incoming subscription request in smack openfire android

孤人 提交于 2019-12-02 12:41:01
I am creating an android chat application using smack openfire.The problem that i am facing is i know how to send and accept subscription request but how can i know if i have received any subscription request. I have used Stanza listener but the listner is only listening to incoming chat messages not subscription request. Below is my code StanzaFilter filter=new StanzaTypeFilter(Message.class); PacketCollector collector=connection.createPacketCollector(filter); connection.addAsyncStanzaListener(new StanzaListener() { @Override public void processPacket(Stanza packet) throws SmackException

How the XMPP client must notified of new Message, when app is in background?

会有一股神秘感。 提交于 2019-12-02 08:09:11
问题 Considering OPENFIRE not supports XEP-0357 (Push Notification), then how the client must notified of new messages? Does the user connection must be always AVAILABLE? But in other messaging apps like whatsApp, when user goes to background, it's presence turns into UNAVAILABLE. Other problem is for developing iOS version of it that does not supports BACKGROUND-SERVICE like as in android exists. What the other IM clients do in this situation? 回答1: I founded my answer myself. I developed a local

How to read custom attributes of xmpp message tag in android?

本小妞迷上赌 提交于 2019-12-02 07:19:52
The xml that i need to receive is : <message id="qm5Dx8" to="adsfxcv" type="chat"from="adsf" msgType="2" thumbnail="randomThumbnail" serverMediaURL="random" isFromMe="1" status="1"><body>Image</body><request xmlns='urn:xmpp:receipts'/></message> Message is being sent by MyCustomMessage extends Message class. In my message listener, Where i need to get the packet is : public void processPacket(Packet packet) { String recivedPacket = packet.toXML(); try { if (packet instanceof MyCustomMessage) { MyCustomMessage msg = (MyCustomMessage) packet; .... But I am receiving only id,to,type and from in

How the XMPP client must notified of new Message, when app is in background?

余生长醉 提交于 2019-12-02 02:47:01
Considering OPENFIRE not supports XEP-0357 (Push Notification), then how the client must notified of new messages? Does the user connection must be always AVAILABLE? But in other messaging apps like whatsApp, when user goes to background, it's presence turns into UNAVAILABLE. Other problem is for developing iOS version of it that does not supports BACKGROUND-SERVICE like as in android exists. What the other IM clients do in this situation? I founded my answer myself. I developed a local API in my server, to send push notification. This local API will have all the users tokens per jids (when

How to configure Push mode configuration in XMPP with FCM refresh token using smack in android?

*爱你&永不变心* 提交于 2019-12-01 19:08:31
Currently i'm using smack library for XMPP configuration and I want to do XMPP connection of Ejabberd to firebase by send RefreshToken to XMPP. I need to close connection when application is in background or kill and receive notification from Firebase but how can i send refresh token and other param as below using smack library? At the start of each session the user must register to a push mechanism. Depending on the chosen mechanism, several parameters can be passed. The push configuration packet could be something like: <iq type='set' id='123'> <push xmlns='p1:push'> <keepalive max="30"/>