Storage & Playback

Store real-time message streams for future retrieval and playback

What it Does

  • Populate chat, collaboration and machine configuration on app load
  • Retrieve historical data streams for reporting, auditing and compliance (HIPAA, SOX, Data Protection Directive, and more)
  • Replay live events with delivery of real-time data during rebroadcasting

Features

  • Storage of all real-time data for any length of time
  • History to retrieve messages across a time period
  • Replay of all messages in the order and time originally sent

Resources

Get the Code
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
  1. // retrieve last 100 messages
  2.  
  3. pubnub.history({
  4. channel : 'my_channel',
  5. count : 100,
  6. callback : function(m){console.log(m)}
  7. });
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
  1. // retrieve last 100 messages
  2.  
  3. pubnub.DetailedHistory<string>(channel=
  4. "mychannel", recordCountToRetrieve=100,
  5. DisplayReturnMessage, DisplayErrorMessage);
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
  1. // retrieve last 100 messages
  2.  
  3. requestHistoryForChannel:(myChannel)
  4. from:(nil)
  5. to:(nil)
  6. limit:(NSUInteger)100
  7. reverseHistory:(YES);
    1. 1
    2. 2
    3. 3
    4. 4
    5. 5
    6. 6
    7. 7
    8. 8
    9. 9
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
  1. // retrieve last 100 messages
  2.  
  3. pubnub.detailedHistory(channel, 100,
  4. new Callback() {
  5. public void successCallback(String channel,
  6. Object message) {
  7. notifyUser(message.toString());
  8. }
  9. public void errorCallback(String channel,
  10. Object message) {
  11. notifyUser(channel + " : " +
  12. message.toString());
  13. }
  14. });
Watch the Video