6

This question is similar, but the answer did not help.

The goal is to cache a single web page to the home screen, and launch this web page successfully even in offline mode.

Launching the web page from the home screen succeeds when there's a network, but it fails in offline mode because Safari complains there's no connection the server.

The web page contains this meta tag:

  <meta name="apple-mobile-web-app-capable" content="yes"  />

Is this possible with web apps on iOS?

Crashalot
  • 33,605
  • 61
  • 269
  • 439

3 Answers3

9

We fixed this by supporting a cached version of the app with the manifest attribute as follows:

<!DOCTYPE HTML>
<html manifest="/cache.manifest">
....
</html>

The cache.manifest file:

CACHE MANIFEST

# Version 0.0.2

NETWORK: *

CACHE:
ShareIconTutorial.png
HomeScreenIcon.png

FALLBACK:

Documentation is outdated on this topic because of PWAs, so hope this helps someone in the future!

Crashalot
  • 33,605
  • 61
  • 269
  • 439
0

apple-mobile-web-app-capable means,

If content is set to yes, the web application runs in full-screen mode; otherwise, it does not. The default behavior is to use Safari to display web content. You can determine whether a webpage is displayed in full-screen mode using the window.navigator.standalone read-only Boolean JavaScript property.

Doc

If you want caching you can try a Progressive Web App and I do not think iOS supports it.

naz
  • 1,478
  • 2
  • 21
  • 32