title: iOS Meteor Cordova app: all app graphics disappear after a few minutes
body: <p>I've got a working Meteor Cordova app that installs and runs on both iOS and Android devices. However, on iOS only, and only if the iPhone is <em>not</em> plugged into xCode, <em>all</em> of the graphic assets disappear from the app and show as nothing -- no broken pic image or box outline or different color, just the color of the background as though nothing was ever there. They don't disappear while you stare at the current screen, you have to go to a different screen or leave and return to the app, but once it happens, all the graphics are gone. It doesn't even affect formatting of page content. Just poof, no more graphics.</p>
  
  <p>Since it's on-device only and doesn't happen if plugged into xCode, I haven't been able to get any possible error messages. Plus, the app still works fine. And if I kill the app and restart it, the icons all come back.</p>
  
  <p>Maybe this is a behavior of the internal web server that Cordova does to get around the WKWebView-no-local-assets issue? Maybe it's a code issue (I've had another iOS-only issue that was a string vs number thing in how iOS and Android act differently). But since I can only reproduce it on-device and without connection to debugging, I'm hoping someone knows the answer.</p>
  
  <p>I keep all of my graphics in <code>/public/images</code>, if that's a clue. But the fact that it doesn't happen on Android is really a stumper.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>More info. I've used Xcode to examine the console log and found these log entries that clearly show the image resources are being successfully retrieved.    </p>
  
  <p><code>Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6275] &lt;Notice&gt;: TIC TCP Conn Event [162:0x12bd42470]: 1 Err(0)
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6275] &lt;Notice&gt;: TIC TCP Conn Connected [162:0x12bd42470]: Err(0)
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6275] &lt;Notice&gt;: TIC TCP Conn Cancel [162:0x12bd42470]
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6275] &lt;Notice&gt;: TIC TCP Conn Destroyed [162:0x12bd42470]
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.WebContent(WebKit)[6276] &lt;Notice&gt;: 0x10e2f1148 - WebResourceLoader::didReceiveResponse: (pageID = 2, frameID = 1, resourceID = 239, status = 200)
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.WebContent(WebKit)[6276] &lt;Notice&gt;: 0x10e2f1148 - WebResourceLoader::didReceiveData: Started receiving data (pageID = 2, frameID = 1, resourceID = 239)
  Jan  4 15:06:00 Andys-iPhone-7 com.apple.WebKit.WebContent(WebKit)[6276] &lt;Notice&gt;: 0x10e2f1148 - WebResourceLoader::didFinishResourceLoad: (pageID = 2, frameID = 1, resourceID = 239)</code>  </p>
  
  <p>but then when the problem occurs, the log is this:  </p>
  
  <p><code>Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6252] &lt;Notice&gt;: TIC TCP Conn Event [141:0x159e0d9f0]: 3 Err(61)
  Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6252] &lt;Error&gt;: TIC TCP Conn Failed [141:0x159e0d9f0]: 1:61 Err(61)
  Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6252] &lt;Notice&gt;: TIC TCP Conn Cancel [141:0x159e0d9f0]
  Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6252] &lt;Notice&gt;: TIC TCP Conn Destroyed [141:0x159e0d9f0]
  Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(WebKit)[6252] &lt;Notice&gt;: 0x103184b40 - NetworkResourceLoader::start: Retrieving resource from cache (pageID = 2, frameID = 1, resourceID = 224, isMainResource = 0, isSynchronous = 0)
  Jan  4 14:31:00 Andys-iPhone-7 com.apple.WebKit.Networking(CFNetwork)[6252] &lt;Error&gt;: HTTP load failed (error code: -1004 [1:61])
  </code>  </p>
  
  <p>The -1004 error is cannot connect to host. So, this app is successfully getting images from, I think, the internally existing content server, but that breaks after a few minutes. </p>
  
  <p>Does anyone have any ideas? Meteor 1.6, newest xCode, iOS 10, btw. Thanks! </p>