Offline iOS Web App says it requires an internet connection, even though it doesn't?

1.2k Views Asked by At

I'm trying to make an iOS Offline Web App (the web pages that are saved to the home screen and are a bit difficult to tell from native iOS apps).

My app consists of just two files:

index.html

<meta name="apple-mobile-web-app-capable" content="yes" />
<html manifest="cache.manifest">
    <script type="text/javascript">
        document.addEventListener('DOMContentLoaded', function(event) {
            alert("Welcome to the site.");
        });
    </script>
</html>

cache.manifest

CACHE MANIFEST

# Version 0.0.2

If I navigate to the page in mobile Safari, it properly pops open the alert. If I put it into airplane mode, turn off wifi, force quit safari, and restart my iPhone, mobile Safari loads from the cache and pops open the alert just fine.

If I then save the page to my Home Screen (give it the name "Repo", for example), then attempt to open it, it'll pop open this error message:

Cannot Open Repo

Repo could not be opened because it is not connected to the Internet.

What's going on here? Why is mobile safari properly loading it from the cache, but the moment I try saving and opening it, it tells me it needs an Internet connection?

0

There are 0 best solutions below