PUBNUB here_now returns invalid channel list

I have subscribed to a new channel as well as new publish_key and sub_key where I want to see a complete list of channels with these keys. So I am using

PUBNUB.here_now({
uuids:true,
callback:function(w){
console.log(w);
}
});

      

And it returns 1300 channels with thousands of busyness where it should return a list of channels with 2 channels because I am only subscribed with 2 channels.

you can also check this using the developer console.

Please provide me with a solution, why is this happening?

+3


source to share


1 answer


Finally, I got a solution while you've been pushing your head all day. When I looked into the library I found out that if we provide values ​​to PUBNUB.init () and we store it intstance it will take a "demo" how the keys are there

For example:

 PUBNUB.init({
    publish_key://my publish key,
    subscribe_key://my subscrition key
 });

      

then

PUBNUB.here_now({
   uuids:true,
   callback:function(e){
   console.log(e);
  }
});

      



It will return values ​​according to the "demo" keys, because you PUBNUB.init () returns an instance that points to some SELF function of the library, so if you don't call methods with the returned instance, it will return values ​​according to " demo ", keys are different. Take a look

var pubnub=PUBNUB.init({
    publish_key://my publish key,
    subscribe_key://my subscrition key
  }); 

      

then

pubnub.here_now({
    uuids:true,
    callback:function(e){
    console.log(e);
   }
 });

      

Where, according to this, should an error be returned if you are not using a PUBNUB instance, because that can confuse the developer as to why he is not getting the correct values ​​if he does not examine the library code.

+4


source







All Articles