PubNubSimpleHistory 0.1.1

PubNubSimpleHistory 0.1.1

TestsTested
LangLanguage SwiftSwift
License MIT
ReleasedLast Release Apr 2016
SPMSupports SPM

Maintained by Terry Xu.



PubNubSimpleHistory

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Methods

Download messages from now backward in time, until limit is reached or end of channel history is reached. Messages are returned in chronological order (oldest to newest). Useful to get latest messages in a channel.

public func downloadLatestMessages(inChannel: String, 
    limit: Int, 
    pageSize: Int? = default, 
    completion: ([[String : AnyObject]], PNErrorStatus?) -> Void)

Download messages from now backward in time, until limit is reached, reached a certain point in time, or end of channel history is reached. Messages are returned in chronological order (oldest to newest). Useful to get latest messages in a channel where messages beyond a certain age are no longer valuable.

public func downloadLatestMessagesNewerThan(inChannel: String, 
    limit: Int?, 
    newerThan: NSNumber? = default, 
    pageSize: Int? = default, 
    completion: ([[String : AnyObject]], PNErrorStatus?) -> Void)

Download messages from a given timetoken backward in time, until the limit is reached or end of channel history is reached. Messages are returned in chronological order (oldest to newest). Useful to get older messages from a known time, e.g. pagination.

public func downloadMessagesOlderThan(inChannel: String,
    limit: Int, 
    olderThan: NSNumber, 
    pageSize: Int? = default, 
    completion: ([[String : AnyObject]], PNErrorStatus?) -> Void)

Requirements

Installation

PubNubSimpleHistory is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "PubNubSimpleHistory"

Author

Terry Xu @coolnalu

Kevin Flynn @KevinMarkFlynn

License

PubNubSimpleHistory is available under the MIT license. See the LICENSE file for more info.