You can choose from two methods for retrieving the history of a channel. It returns the history(if available) in JSON format with message timestamp.
If you do not wish to receive the timestamp of each message, set returnTimestamp
to false
. By default it is set to true
and it is not compulsory to declare.
a. Count:
50 latest messages will be returned from the server without timestamps.
pusheo.history({
channel: "12345",
count: 50,
returnTimestamp: false,
callback: onHistoryReceived
});
b. Timestamp:
Messages from the given timestamp till date will be returned with timestamps.
pusheo.history({
channel: "12345",
returnTimestamp: true,
timestamp: 1376577675622,
callback: recievedHistory
});