title: PunNub - Best way to recover lost messages when device was turned off?
body: <p>We have multiple mobile clients (ios and android) subscribed to a channel-msg.</p>
  
  <p>7 messages are being published to channel-msg by the server:<br>
  <a href="https://i.stack.imgur.com/LWcZd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LWcZd.png" alt="enter image description here"></a></p>
  
  <ol>
  <li>Messages 1-3 were published to channel.</li>
  <li>The device got messages 1-3 via native PubNub.</li>
  <li>The user turned the device off.</li>
  <li>Messages 4-5 were published to channel.</li>
  <li>The user turned the device on, and app in foreground.</li>
  <li>Message 6 is published.</li>
  <li>Message 6 arrives to the device. </li>
  </ol>
  
  <p>At this point (in the "got PubNub message" callback in the device's code), I don't want to perform Message 6, because <strong>I must perform Messages 4-5 first</strong>.</p>
  
  <p>I can use the history() API to get the lost messages, but with this strategy I am forced to perform the "history check" on each message I receive on the device, before I can execute it.  </p>
  
  <p>I there a better pattern/design to handle this scenario? </p>