When fetching messages from Pubnub, its receiveDate
is nil. Here's an example attached on what I'm doing:
void (^completionBlock)(NSArray *pnMessages, PNChannel *channel, PNDate *fromDate, PNDate *toDate, PNError *error) = ^(NSArray *pnMessages, PNChannel *channel, PNDate *fromDate, PNDate *toDate, PNError *error) {
for (PNMessage *pnMessage in pnMessages) {
NSDate *date = pnMessage.receiveDate; // <-- date here is nil (pnMessage.date also)
// some logic here with date.
}
// fetch messages.
[PubNub requestFullHistoryForChannel:_channel withCompletionBlock:completionBlock];
Any ideas something else has to be done to retrieve the date for each message?