Pusheo Documentation

Step by step instructions for easy installation and configuration of Pusheo.

Initialize

a. Normal Mode : ‘subscribe’ key and ‘publish’ key both are required. In this mode, you can publish as well as RECEIVE messages.

 Pusheo cometClient = new Pusheo("http://SERVER_IP:8080/pusheo/", "publish_key", "subscribe_key", new MyCallbacks(), YourActivity.this);

b. Subscribe-only Mode : ‘publish’ key not required (Pass ‘publish_key’ as nullor ""). In this mode, you can ONLY RECEIVE messages but you CANNOT PUBLISH messages to any channel. History will be available.

Pusheo cometClient = new Pusheo("http://SERVER_IP:8080/pusheo/", null, "subscribe_key", new MyCallbacks(), YourActivity.this);

c. Publish-only Mode : ‘subscribe’ key and ‘publish’ key both are required. In this mode you can publish messages but you CANNOT RECEIVE MESSAGES. History will NOT be available.

Pusheo cometClient = new Pusheo("http://SERVER_IP:8080/pusheo/", "publish_key", "subscribe_key", new MyCallbacks(), YourActivity.this);
  • After initializing Pusheo object, you can to configure the parameters as follows:
    cometClient.lostMessageCall(true)
    .lostMessageCallInterval(20)
    .reconnect(false)
    .requestTimeoutInSeconds(10)
    .pauseBeforeReconnectInSeconds(5);
  • If you don’t configure, the default options are automatically used. By default, LostMessageCalls are active with an interval of 10 seconds.