I'm developing an app with PubNub
iOS
SDK
that works great, but there is one annoying issue with the History API
.
I have to list the message history in multiple view controllers, that works well, but I have to wait 2-3 second for the messages every time I open a new view. Is there any common practice to avoid this?
I'm using the requestHistoryForChannel
: with block in every view controllers viewDidLoad
. I know it's a problem because every time I open a new view the client needs to reconnect and retrieve the history again, but i could not find a better solution. I have to download the same channel's history in every view, so the content is always the same, therefore I think it's absolutely possible to fetch the messages when I launch the app and use that data across the whole app and don't wait, but I have no idea how to do it.