We have an https webapp using an html cache manifest so it can run offline.
We instruct our users to add it to the homescreen for the best experience (no address bar on phones, etc etc). We have an issue where if you remove the app from the homescreen, close safari and then re-open and re-add to homescreen, the app will not use the app icon and cannot complete https requests and is missing some cached data.
The app will continue to always work great in safari itself, all resources are cached and loaded, and all https requests work fine.
Here are the steps to reproduce this, we have done it on an iOS 7 iPhone, iOS 8 iPhone, and an iOS 7 iPad2. This may work for other webapps making https requests and using cache manifests, but I'm not sure. This reproduces with a real cert as well as a self-signed cert.
Steps to Break the Webapp
Steps to FIX the webapp
https://OurWebappURL
Here is the chunk of the html <head>
tag that tells it to run as a webapp and use an app icon (it's cross-platform).
<html lang="en" manifest="cache.manifest">
<head>
<title>Our App Title</title>
<!-- Enable the homescreen app on mobile devices -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<!-- Enable the App Icon -->
<link rel="icon" type="image/png" sizes="196x196" href="images/AppIcon.png">
<link rel="apple-touch-icon" href="images/AppIcon.png">
<link rel="apple-touch-startup-image" href="https://ourURL/images/iPhoneStartup.png">
<meta name="viewport" content="width=device-width" />
<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no, height=device-height, width=device-width" />
<meta http-equiv="content-language" content="en">
If we remove the <meta name="apple-mobile-web-app-capable" content="yes" />
, causing it to open safari and load the app there, it works fine, as it's just running inside safari. However, this is not the experience we want, so it is a workaround, not a solution. This also doesn't fix the issue of adding to homescreen the second time, the logo is still not used.
We're not registered as apple developers so I can't log a bug report. Please chime in with any ideas or feedback, this is a very tough one!
EDIT: I've now tested this with an http (no SSL) version of the same application and it works fine, this appears to be an https issue.
We determined that the cause of this is having a wildcard cert that has an incomplete certificate chain, or by using a self-signed cert.
Fully signed single-domain certs work great most of the time, and we're recommending that to our clients, but it appears that you can repair cert chains by contacting your cert provider and requesting the intermediate certs to install.
We did not do that in this case, we went to a single-domain cert with a shorter chain, as far as I can tell.