title: Push Notification vs. Web Sockets for implementing a real-time chat app?
body: <p>I'm looking into building a real-time chat app for iPhone (but this question applies to Android and other devices as well) Basically I want the app to receive realtime messages while it's open as well as while it's closed, just like the iPhone's own "Message" app.</p>
  
  <p>When it's closed I can use the native push notification services like APNS, and when the app is open, I can run my own websockets server or use 3rd party providers like PubNub or Pusher, which is what I've been doing actually.</p>
  
  <p>Then I wondered: Why can't I completely rely on APNS for the real-time messaging, both while the app is open and while it's closed? This feels like a much cleaner solution since it's driven by one push server. Could someone enlighten me? Thanks.</p>