I am currently trying to get the history of a channel in js, here is my current code:
Send message
function sendMessage(text){
box=$('box')
box.innerHTML = ('' + text).replace(/[<>]/g, '') + '<br>' + box.innerHTML
}
Here is my current code for getting history
pubnub.fetchMessages(
{
channels: ['ch-1'],
end: '15343325004275466',
count: 20
},
(status, response) => {
sendMessage(response.messages[0])
}
);
But it is not working. can someone please help
Please try this syntax:
Another possibility is you have persistence disabled in your admin dashboard (or the period of retention is set too short so you have no stored messages to retrieve)