powered by Jive Software

XMPP Response IQ doesn't show or bring back the IQ response

Running following code with ejabberd server at back and it performs its tasks. However, this doesn’t show up in ejabberd log/debug file and/or IQ response isn’t getting back to client device (smack 4.4.2). How can I get the IQ response back, do we need to add code in this code for returning the IQ result/response? or I am missing something?

            DataForm.Builder xep0004 = DataForm.builder(DataForm.Type.submit);  //new DataForm(DataForm.Type.submit);
            TextSingleFormField.Builder token = FormField.builder("token");
            TextSingleFormField.Builder device_id = FormField.builder("android-id"); //new FormField("device-id");

            IQ pushStanza = new IQ("command", "http://jabber.org/protocol/commands") {
                protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
                    xml.attribute("action", "execute");
                    xml.attribute("node", "register-push-fcm");
                    return xml;
            if (connection.isSmEnabled()) {
                try {
                    connection.addStanzaIdAcknowledgedListener(pushStanza.getStanzaId(), new StanzaListener() {
                        public void processStanza(Stanza stanza) throws NotConnectedException, InterruptedException, SmackException.NotLoggedInException {
                            Log.e("stanza result", stanza.toXML().toString());
                           // registerTokenToXmpp1();
                } catch (Exception e) {

Openfire does not have support for this particular ad-hoc command, which is why you do not get a result (you should get an error response back though).

This seems to relate to push notifications (XEP-0357). This particular ad-hoc command is used by the client to invoke an action on the app-server. Openfire rarely acts as an app server, but, through the Push Notifications plugin does support push notifications. Is that perhaps what you need (in combination with a third-party app-server)?

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.