AnsweredAssumed Answered

Trying to subscribe to pubsub queues notifications

Question asked by armandoramirez on Oct 26, 2016
Latest reply on Oct 26, 2016 by armandoramirez

I followed the sample code from the Non Gadget and I can get user notifications and dialog notification but no queues info.

This is the code I have, I put the sendIq function inside the successCallback


I just want to subscribe to realtime queue changes.  Thank you


   var _username = "1041";
   var _domain = "";
   var _password = "password";

function _eventConnect() {
    if (window.jabberwerx) {
        //Construct JID with username and domain.
        jid = _username + "@" + _domain,

        //Create JabbwerWerx object.
        _jwClient = new jabberwerx.Client("resource");

        //Arguments to feed into the JabberWerx client on creation.
  jwArgs = {
            //Defines the BOSH path. Should match the path pattern in the proxy
            //so that it knows where to forward the BOSH request to.
            httpBindingURL: "",
            //Calls this function callback on successful BOSH connection by the
            //JabberWerx library.
  errorCallback: onClientError,
            successCallback: function () {
                //Get the server generated resource ID to be used for subscriptions.

  _jwClient.sendIq('set', "", "<pubsub xmlns=''><subscribe node='/finesse/api/Queue/3' jid='' /></pubsub>", function(data){

        jabberwerx._config.unsecureAllowed = true;
        //Bind invoker function to any events that is received. Only invoke
        //handler if XMPP message is in the specified structure.
                "event[xmlns=''] items item notification",
  _jwClient.event("clientStatusChanged").bind(function(evt) {


        //Connect to BOSH connection.
        _jwClient.connect(jid, _password, jwArgs);
    } else {
        alert("CAXL library not found. Please download from")