title: iOS app with real-time updates from server: Socket (using streams) or Apple Push Notification service?
body: <p>I'm trying to make an iOS 5 app that features real-time things coming from the server. It will only use these whilst the app is running.</p>
  
  <p>To make it real-time without polling I have been evaluating two design routes:</p>
  
  <p><br />
  <strong>Creating a socket from the app to the server, and exchanging information via streams.</strong></p>
  
  <ul>
  <li><em>Pros:</em> Relatively simple and would not involve a 3rd party. </li>
  <li><em>Cons:</em> Battery life drain. </li>
  <li>For an overview of how this might work, check
  out this excellent tutorial:
  <a href="http://www.raywenderlich.com/3932/how-to-create-a-socket-based-iphone-app-and-server">http://www.raywenderlich.com/3932/how-to-create-a-socket-based-iphone-app-and-server</a></li>
  </ul>
  
  <p><strong>Using standard HTTP to communicate with the server, and with each request from the app let the server know what they are viewing. If something new is available for user, send an Apple Push Notification (with no visible alert) to let app know it can go and download new thing.</strong></p>
  
  <ul>
  <li><em>Pros:</em> Not opening up a new TCP connection, so battery life not drained unnecessarily.</li>
  <li><em>Cons:</em> Feels like a poor hack.</li>
  <li>The official docs on APNs <a href="http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html">http://developer.apple.com/library/mac/#documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ApplePushService/ApplePushService.html</a></li>
  </ul>
  
  <p><br /> 
  I think a socket would be the way to go, but before I commit to it I wanted a second opinion, as this is the first time I've made anything like this!</p>