0

I am working on a web application that can be used online as well as offline. The user has the choice to download the content or not. That for a prompt opens and redirects him to a page that contains the manifest attribute on the HTML tag.

This works like a charm, the browser behaves as expected and downloads everything listed in the manifest and works in offline mode.

Now if the user adds the page to his homescreen, before he choses to download the content. He obviously gonna link to the page that has no manifest attribute.

If he choses to downloads the content from the webapp on his homescreen, the App will refuse to work in offline mode.

I suppose it is because the manifest tag is missing on file IOS originally cached/linked to on the homescreen.


Short overview:

Go Online -> Safari -> Chose to download appcache -> Add to homescreen -> Go Offline -> Open Webapp from Homescreen -> Works

Go Online -> Safari -> Add to homescreen -> Open Webapp from Homescreen -> Choose to download appcache -> Go Offline -> Open Webapp from Homescreen -> Does not work


How would you handle this? Is there any way to choose what file is linked on the homescreen? Coud I always serve a empty manifest file and populate it only for the version on the Homescreen? Do I miss something obvious?

meo
  • 30,872
  • 17
  • 87
  • 123
  • Works fine for me. You might have to update the app cache (window.applicationCache.update()) after reloading the page with a manifest. – backflip May 24 '12 at 21:47
  • What exactly does work fine for you? This answer is not helpful at all... Do you have any working example? – meo May 25 '12 at 07:40
  • Well, I followed your description and it worked fine when I updated the cache using JavaScript. If you expect a code example I would suggest providing your initial one, too. Otherwise one could assume you don't. ;) – backflip Jun 07 '12 at 15:33
  • i was not expecting a code example. Just an answers that is actually an answers not a comment. – meo Jun 07 '12 at 17:01

1 Answers1

1

Try to add the start page without manifest attribute to the pages listed in the cache manifest. Once the browser will have downloaded the manifest it shouldn't have to rely on the attribute anymore.

Betabong
  • 56
  • 3