smack

Why the openfire's user remains ONLINE even with no SESSION exists in sessions

筅森魡賤 提交于 2019-12-01 05:48:30
I'm developing an android app contains "Messaging" using OpenFire as an XMPP server and using Smack for android client. All functions works fine, but when a user is online(as you can see it's state in admin panel of openfire), and network connectivity disconnected suddenly, the session of it will be destroyed, but the user remains ONLINE in server! Thus, the packets not stores in server as an offline messages and will be sent to user even the user is offline and packets will be lost! I was tested an windows client (Spark), but when its connectivity losing, session in server will be destroyed

When to disconnect bosh connection establish from app server to use prebinding in strophe?

大憨熊 提交于 2019-12-01 05:40:00
问题 This question is Extension of my previous question on this SO question "How to connect XMPP bosh server using java smack library?" I am using Java as server side language. I have successfully implement xmpp BOSH connection using smach-jbosh thanks to @Deuteu for helping me to achieve this, so far I have modify jbosh's BOSHClient.java file and added two getter method for extracting RID and SID. Now I have RID and SID on my app server (I am using Apache Tomcat). I need to pass this credential

How to connect XMPP bosh server using java smack library?

浪尽此生 提交于 2019-12-01 05:10:51
问题 I have working xmpp client on webapp using strophe.js ,as per my use case scenario i have to switch to different pages rapidly Current approach is not secure as jid and password is visible in java script ,I was finding work around to implement security in strophe client an trying to make connection time(with bosh) more shorter ,while going through the book "XMPP Programming with JavaScript and jQuery"by jake moffitt i came across one solution which element both of my above problems is to

send and receiving message using smack API

萝らか妹 提交于 2019-12-01 03:48:45
I have setup my open fire(jabber server) on local machine with two user testuser1 and testuser2 .using Spark client both users perform chat without any issue,it's nice. openfire IP -192.168.1.65 I want to use smack API(3.3.0) for send and receiving message. i have write sender side code to send message(with testuser1) and tested with Spark client(with testuser2) message received on testuser2 side,but when i try with java code to receive sender message ,i am not able to receive those publish messages. Sender.java import org.jivesoftware.smack.Chat; import org.jivesoftware.smack.XMPPConnection;

Why the openfire's user remains ONLINE even with no SESSION exists in sessions

*爱你&永不变心* 提交于 2019-12-01 03:46:56
问题 I'm developing an android app contains "Messaging" using OpenFire as an XMPP server and using Smack for android client. All functions works fine, but when a user is online(as you can see it's state in admin panel of openfire), and network connectivity disconnected suddenly, the session of it will be destroyed, but the user remains ONLINE in server! Thus, the packets not stores in server as an offline messages and will be sent to user even the user is offline and packets will be lost! I was

Creating new user with Smack on ejabberd throws XMPP Exception: forbidden(403)

不羁岁月 提交于 2019-11-30 21:49:07
Hi I am working on ejabberd and I am quite new to this technology. I am trying to add a user on my ejabberd server using this code: try { conf.setSASLAuthenticationEnabled(true); connection.connect(); Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.manual); Log.i("XMPPClient", "Connected to " +connection.getHost()); createUser("tester","testerpass"); } } catch (XMPPException e1) { Log.e("XMPPClient", e1.toString()); xmppClient.setConnection(null); } public void createUser(String user, String pass) { try { //Admin login connection.login(user, pass); } catch (XMPPException e) { e

Android smack library subscription(not showing inbond or outbond notifications)

血红的双手。 提交于 2019-11-30 20:54:00
问题 I am working on an android chat application in which i am using smack library for instant messaging everything is working fine but the huge problem is in subscription. How to send subscription notification to another user. Here is my code for sending subscription request: public void run() { /*runOnUiThread(new Runnable() { public void run() {*/ Roster roster = XMPPSmackConnection.getInstance().connection.getRoster(); roster.setSubscriptionMode(Roster.SubscriptionMode.manual); try { if(!

Smack throws “NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils”

荒凉一梦 提交于 2019-11-30 20:31:19
I got a problem with my app in which I want to create a simple XMPP client that connects to my server. I got the following problem when I'm starting the app (compilation runs through without problems), but my app closes instantly. java.lang.NoClassDefFoundError: Failed resolution of: Lorg/jxmpp/util/XmppStringUtils; at org.jivesoftware.smack.provider.ProviderManager.getKey(ProviderManager.java:314) at org.jivesoftware.smack.provider.ProviderManager.addStreamFeatureProvider(ProviderManager.java:304) at org.jivesoftware.smack.provider.ProviderManager.addLoader(ProviderManager.java:140) at org

How to get custom attribute value from an XMPP XML message?

爷,独闯天下 提交于 2019-11-30 20:15:43
Ok guys, simple question but pretty important to me. so, other android client are sending this xml msg: <message id='6ymdM-19' to='xox@xox.xox/smack' type='chat'> <subject>normal</subject> <received xmlns='urn:xmpp:receipts' id='HVgQw-5'/> </message> and my listener is roughly like this: private class MsgListener implements ChatStateListener { /** * Constructor. */ public MsgListener() { } @Override public void processMessage(Chat chat, org.jivesoftware.smack.packet.Message message) { String xmlMessage = message.toXML(); Log.v(TAG, "XML Chat: "+xmlMessage); // getExtension namespace try urn

Custom extension element in Stanza for Smack 4.1.4

╄→尐↘猪︶ㄣ 提交于 2019-11-30 20:07:52
问题 I am moving my android application from asmack-android library to Smack 4.1.4. I have some PacketExtensions in the asmack version of Smack, which uses PacketExtension and PacketExtensionProvider classes to handle. Since the PacketExtension is deprecated in Smack 4.1.4, I am confused among the classes and interfaces ExtensionElement, DataPacketExtension, ExtensionElementProvider , DefaultExtensionElement. Could any one of you give me an example of creating an extension which can be added with