In my App I'm using PubNub channels to read messages.
I get history in two status :
.PNReconnectedCategory
.PNConnectedCategory
I get history like this way:
if let lastOpenedDate = NSUserDefaults.standardUserDefaults().objectForKey(PubNubModel.lastHistoryFetchKey) as? NSDate {
let endDate = NSNumber(double:lastOpenedDate.timeIntervalSince1970)
if UserHistoryChannel != nil {
self.client?.historyForChannel(UserHistoryChannel!, start: nil, end: endDate, withCompletion: getHistoryCompletionBlock)
}
}
lastOpenedDate is a last received message date, and
in getting history I always check on it, and getting the history from this date and after it.
on logout I set this date to nil, so when the user login to the App, and Pubnub connect, when getting history this date will be the current date, and there will be no history.
But the pubnub still getting the old history!!
anyone try to clear the pubnub channels history?
Any help pleasssse?
thanks,