Pregunta

I am trying to find the clients subscribed to a particulair channel. On git I found an example which used a function here_now() with 2 parameters. Something like this:

                    pubnub.hereNow(channel, new Callback() {
                    public void successCallback(String channel,Object message) {
                        notifyUser("HERE NOW : " + message);
                    }

                    public void errorCallback(String channel,
                            Object message) {
                        notifyUser("HERE NOW : " + message);
                    }
                    });

But in my company's application the here_now() function takes only one parameter i.e a String. I am relatively new to pubnub. Can anyone explain me what this parameter is? is it a channel name? how do I specify the call back functions? I am not able to find any documentation related to here_now(String arg)

Thanks

¿Fue útil?

Solución

Please run the PubNubDemoConsole.java... you can walk through how all the API calls work.

Specifically, for here_now():

https://github.com/pubnub/java/blob/master/java/examples/src/com/pubnub/examples/PubnubDemoConsole.java#L157

(Looks a lot like above :)

You are indeed passing it two arguments. The first is the channel name you want stats for, the second parameter is the callback function to deliver the success or error results on.

Be sure you are on the latest PubNub for Java version as well:

https://github.com/pubnub/java/blob/master/java

If there are additional questions, let us know here, or via support at pubnub.com

geremy

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top