iOS 12 does not support offline feature of some PWAs












0















iOS 12 Safari does not support the offline feature of some PWAs (Progressive Web App). It seems like Safari does not cache resources in those web apps properly.



For example, the following PWAs cannot work offline in iOS 12 and 12.1, but they all work perfectly in Chrome on Android or Windows:



The Air Horner PWA that is used by google to demonstrate Service Worker:
Air Horner



And these two:
2048 puzzle
Voice Memos



Steps to reproduce (100% reproducible):




  1. visit the PWA with Safari (iOS 12 or 12.1)

  2. close the PWA tab in Safari

  3. push home button on iPhone to set Safari to background

  4. push the iPhone power button to turn off screen

  5. push the iPhone power button again to wake up the phone

  6. turn off all the network connection from the iPhone control center (both wifi and cellular)

  7. open Safari, visit PWA again --> the web app fail to load


This has been bothering me for a long time, as my own web app also has the similar issue - works fine in Chrome on Android / Windows but only fails on iOS 12 Safari. Any idea what special in iOS 12 Safari? Thank you very much!










share|improve this question



























    0















    iOS 12 Safari does not support the offline feature of some PWAs (Progressive Web App). It seems like Safari does not cache resources in those web apps properly.



    For example, the following PWAs cannot work offline in iOS 12 and 12.1, but they all work perfectly in Chrome on Android or Windows:



    The Air Horner PWA that is used by google to demonstrate Service Worker:
    Air Horner



    And these two:
    2048 puzzle
    Voice Memos



    Steps to reproduce (100% reproducible):




    1. visit the PWA with Safari (iOS 12 or 12.1)

    2. close the PWA tab in Safari

    3. push home button on iPhone to set Safari to background

    4. push the iPhone power button to turn off screen

    5. push the iPhone power button again to wake up the phone

    6. turn off all the network connection from the iPhone control center (both wifi and cellular)

    7. open Safari, visit PWA again --> the web app fail to load


    This has been bothering me for a long time, as my own web app also has the similar issue - works fine in Chrome on Android / Windows but only fails on iOS 12 Safari. Any idea what special in iOS 12 Safari? Thank you very much!










    share|improve this question

























      0












      0








      0








      iOS 12 Safari does not support the offline feature of some PWAs (Progressive Web App). It seems like Safari does not cache resources in those web apps properly.



      For example, the following PWAs cannot work offline in iOS 12 and 12.1, but they all work perfectly in Chrome on Android or Windows:



      The Air Horner PWA that is used by google to demonstrate Service Worker:
      Air Horner



      And these two:
      2048 puzzle
      Voice Memos



      Steps to reproduce (100% reproducible):




      1. visit the PWA with Safari (iOS 12 or 12.1)

      2. close the PWA tab in Safari

      3. push home button on iPhone to set Safari to background

      4. push the iPhone power button to turn off screen

      5. push the iPhone power button again to wake up the phone

      6. turn off all the network connection from the iPhone control center (both wifi and cellular)

      7. open Safari, visit PWA again --> the web app fail to load


      This has been bothering me for a long time, as my own web app also has the similar issue - works fine in Chrome on Android / Windows but only fails on iOS 12 Safari. Any idea what special in iOS 12 Safari? Thank you very much!










      share|improve this question














      iOS 12 Safari does not support the offline feature of some PWAs (Progressive Web App). It seems like Safari does not cache resources in those web apps properly.



      For example, the following PWAs cannot work offline in iOS 12 and 12.1, but they all work perfectly in Chrome on Android or Windows:



      The Air Horner PWA that is used by google to demonstrate Service Worker:
      Air Horner



      And these two:
      2048 puzzle
      Voice Memos



      Steps to reproduce (100% reproducible):




      1. visit the PWA with Safari (iOS 12 or 12.1)

      2. close the PWA tab in Safari

      3. push home button on iPhone to set Safari to background

      4. push the iPhone power button to turn off screen

      5. push the iPhone power button again to wake up the phone

      6. turn off all the network connection from the iPhone control center (both wifi and cellular)

      7. open Safari, visit PWA again --> the web app fail to load


      This has been bothering me for a long time, as my own web app also has the similar issue - works fine in Chrome on Android / Windows but only fails on iOS 12 Safari. Any idea what special in iOS 12 Safari? Thank you very much!







      ios safari service-worker progressive-web-apps






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 23 '18 at 0:27









      agrulagrul

      14




      14
























          4 Answers
          4






          active

          oldest

          votes


















          0














          I had the same issue, using service worker without Workbox resolved the problem - app starts without internet connection but something is messed up with caching - it's not working.






          share|improve this answer


























          • My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

            – agrul
            Nov 28 '18 at 10:31











          • Share just the crucial code on jsfiddle, I will look to it.

            – tmdoit
            Nov 28 '18 at 21:23











          • Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

            – agrul
            Nov 28 '18 at 23:59













          • I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

            – tmdoit
            Nov 29 '18 at 18:05













          • here it is: bugs.webkit.org/show_bug.cgi?id=192166

            – agrul
            Nov 29 '18 at 19:11



















          0














          I faced the exact same issues.



          What I realized is, all the caches are set correctly when the service worker is activated, but if you close safari with the iOS task manager (not only reduce it), all cached files get completely deleted when going back on the PWA.






          share|improve this answer































            0














            Indeed offline works in the Homescreen. However, the cache does not get updated on new versions & the Homescreen link stops working. To refresh the cache, one is obliged to access the web app from Safari, and then it works again. This is really sub-optimal & will hopefully be fixed.






            share|improve this answer































              0














              The issue is resolved in iOS 12.1.2 on my iPhone 6S.






              share|improve this answer























                Your Answer






                StackExchange.ifUsing("editor", function () {
                StackExchange.using("externalEditor", function () {
                StackExchange.using("snippets", function () {
                StackExchange.snippets.init();
                });
                });
                }, "code-snippets");

                StackExchange.ready(function() {
                var channelOptions = {
                tags: "".split(" "),
                id: "1"
                };
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function() {
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled) {
                StackExchange.using("snippets", function() {
                createEditor();
                });
                }
                else {
                createEditor();
                }
                });

                function createEditor() {
                StackExchange.prepareEditor({
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader: {
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                },
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                });


                }
                });














                draft saved

                draft discarded


















                StackExchange.ready(
                function () {
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439379%2fios-12-does-not-support-offline-feature-of-some-pwas%23new-answer', 'question_page');
                }
                );

                Post as a guest















                Required, but never shown

























                4 Answers
                4






                active

                oldest

                votes








                4 Answers
                4






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0














                I had the same issue, using service worker without Workbox resolved the problem - app starts without internet connection but something is messed up with caching - it's not working.






                share|improve this answer


























                • My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                  – agrul
                  Nov 28 '18 at 10:31











                • Share just the crucial code on jsfiddle, I will look to it.

                  – tmdoit
                  Nov 28 '18 at 21:23











                • Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                  – agrul
                  Nov 28 '18 at 23:59













                • I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                  – tmdoit
                  Nov 29 '18 at 18:05













                • here it is: bugs.webkit.org/show_bug.cgi?id=192166

                  – agrul
                  Nov 29 '18 at 19:11
















                0














                I had the same issue, using service worker without Workbox resolved the problem - app starts without internet connection but something is messed up with caching - it's not working.






                share|improve this answer


























                • My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                  – agrul
                  Nov 28 '18 at 10:31











                • Share just the crucial code on jsfiddle, I will look to it.

                  – tmdoit
                  Nov 28 '18 at 21:23











                • Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                  – agrul
                  Nov 28 '18 at 23:59













                • I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                  – tmdoit
                  Nov 29 '18 at 18:05













                • here it is: bugs.webkit.org/show_bug.cgi?id=192166

                  – agrul
                  Nov 29 '18 at 19:11














                0












                0








                0







                I had the same issue, using service worker without Workbox resolved the problem - app starts without internet connection but something is messed up with caching - it's not working.






                share|improve this answer















                I had the same issue, using service worker without Workbox resolved the problem - app starts without internet connection but something is messed up with caching - it's not working.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Nov 27 '18 at 11:36

























                answered Nov 27 '18 at 8:58









                tmdoittmdoit

                11




                11













                • My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                  – agrul
                  Nov 28 '18 at 10:31











                • Share just the crucial code on jsfiddle, I will look to it.

                  – tmdoit
                  Nov 28 '18 at 21:23











                • Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                  – agrul
                  Nov 28 '18 at 23:59













                • I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                  – tmdoit
                  Nov 29 '18 at 18:05













                • here it is: bugs.webkit.org/show_bug.cgi?id=192166

                  – agrul
                  Nov 29 '18 at 19:11



















                • My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                  – agrul
                  Nov 28 '18 at 10:31











                • Share just the crucial code on jsfiddle, I will look to it.

                  – tmdoit
                  Nov 28 '18 at 21:23











                • Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                  – agrul
                  Nov 28 '18 at 23:59













                • I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                  – tmdoit
                  Nov 29 '18 at 18:05













                • here it is: bugs.webkit.org/show_bug.cgi?id=192166

                  – agrul
                  Nov 29 '18 at 19:11

















                My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                – agrul
                Nov 28 '18 at 10:31





                My app does not use Workbox either. Still not working. The thing is that few offline apps did work, for example, simpleoffline.website and currency-calc.com, weird.

                – agrul
                Nov 28 '18 at 10:31













                Share just the crucial code on jsfiddle, I will look to it.

                – tmdoit
                Nov 28 '18 at 21:23





                Share just the crucial code on jsfiddle, I will look to it.

                – tmdoit
                Nov 28 '18 at 21:23













                Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                – agrul
                Nov 28 '18 at 23:59







                Just take the airhorner as example. Its Service Worker script is here (simple enough): airhorner.com/sw.js. If I follow the steps list in my question above, the app won't load offline. And it does not use Workbox.

                – agrul
                Nov 28 '18 at 23:59















                I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                – tmdoit
                Nov 29 '18 at 18:05







                I've repeated scenario and ended up with the same result. I've asked in comments about this issue bugs.webkit.org/show_bug.cgi?id=190269. Strange is that when you add it to the home screen, run it and then turn off internet connection you can still use it as standalone app - I think the webview treat webapp as a normal cached website. Thats why there are only assets/files downloaded from your visit, there are no assets/files which should be downloaded by service worker - you can test it offline.

                – tmdoit
                Nov 29 '18 at 18:05















                here it is: bugs.webkit.org/show_bug.cgi?id=192166

                – agrul
                Nov 29 '18 at 19:11





                here it is: bugs.webkit.org/show_bug.cgi?id=192166

                – agrul
                Nov 29 '18 at 19:11













                0














                I faced the exact same issues.



                What I realized is, all the caches are set correctly when the service worker is activated, but if you close safari with the iOS task manager (not only reduce it), all cached files get completely deleted when going back on the PWA.






                share|improve this answer




























                  0














                  I faced the exact same issues.



                  What I realized is, all the caches are set correctly when the service worker is activated, but if you close safari with the iOS task manager (not only reduce it), all cached files get completely deleted when going back on the PWA.






                  share|improve this answer


























                    0












                    0








                    0







                    I faced the exact same issues.



                    What I realized is, all the caches are set correctly when the service worker is activated, but if you close safari with the iOS task manager (not only reduce it), all cached files get completely deleted when going back on the PWA.






                    share|improve this answer













                    I faced the exact same issues.



                    What I realized is, all the caches are set correctly when the service worker is activated, but if you close safari with the iOS task manager (not only reduce it), all cached files get completely deleted when going back on the PWA.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 29 '18 at 23:29









                    AlexandreAlexandre

                    1




                    1























                        0














                        Indeed offline works in the Homescreen. However, the cache does not get updated on new versions & the Homescreen link stops working. To refresh the cache, one is obliged to access the web app from Safari, and then it works again. This is really sub-optimal & will hopefully be fixed.






                        share|improve this answer




























                          0














                          Indeed offline works in the Homescreen. However, the cache does not get updated on new versions & the Homescreen link stops working. To refresh the cache, one is obliged to access the web app from Safari, and then it works again. This is really sub-optimal & will hopefully be fixed.






                          share|improve this answer


























                            0












                            0








                            0







                            Indeed offline works in the Homescreen. However, the cache does not get updated on new versions & the Homescreen link stops working. To refresh the cache, one is obliged to access the web app from Safari, and then it works again. This is really sub-optimal & will hopefully be fixed.






                            share|improve this answer













                            Indeed offline works in the Homescreen. However, the cache does not get updated on new versions & the Homescreen link stops working. To refresh the cache, one is obliged to access the web app from Safari, and then it works again. This is really sub-optimal & will hopefully be fixed.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 16 '18 at 19:00









                            JMSJMS

                            61




                            61























                                0














                                The issue is resolved in iOS 12.1.2 on my iPhone 6S.






                                share|improve this answer




























                                  0














                                  The issue is resolved in iOS 12.1.2 on my iPhone 6S.






                                  share|improve this answer


























                                    0












                                    0








                                    0







                                    The issue is resolved in iOS 12.1.2 on my iPhone 6S.






                                    share|improve this answer













                                    The issue is resolved in iOS 12.1.2 on my iPhone 6S.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Dec 25 '18 at 1:41









                                    agrulagrul

                                    14




                                    14






























                                        draft saved

                                        draft discarded




















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid



                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.


                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function () {
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53439379%2fios-12-does-not-support-offline-feature-of-some-pwas%23new-answer', 'question_page');
                                        }
                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        404 Error Contact Form 7 ajax form submitting

                                        How to know if a Active Directory user can login interactively

                                        TypeError: fit_transform() missing 1 required positional argument: 'X'