Ionic-Framework [SOLVED]: ionic 3 publish app as PWA (Progressive Web App)

Ionic-Framework [SOLVED]: ionic 3 publish app as PWA (Progressive Web App)

Home Forums Frameworks Ionic Framework Ionic-Framework [SOLVED]: ionic 3 publish app as PWA (Progressive Web App)

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #115769

    Cloudy Point
    Keymaster

    QuestionQuestion

    I want to publish my app as PWA so what i did is

    insert this script to index.html

    <!--script>
        if ('serviceWorker' in navigator) {
          navigator.serviceWorker.register('service-worker.js')
            .then(() => console.log('service worker installed'))
            .catch(err => console.log('Error', err));
        }
    </script-->
    

    then install

    npm run ionic:build --prod 
    

    it looks like it deploy it but my questions are:

    1. what files I need to upload to host for publish the app as PWA?
    2. why when I change something in the app and run ionic serve nothing changed and it changed only in the index.html of the WWW folder? why?(because now it’s PWA??)

    3. when I open www folder and I run open index.html when i press on button that open alert dialog it not open that. why?

    4. when I run the command? only in the end of development?

    #115771

    Cloudy Point
    Keymaster

    Accepted AnswerAnswer

    Run

    ionic cordova add platform browser

    ionic build browser --prod --release

    Then go to [project_folder]/platforms/browser/www and copy the content at you http server.

    Source: https://stackoverflow.com/questions/44195402/ionic-3-publish-app-as-pwa-progressive-web-app
    Author: Pablo Albaladejo
    Creative Commons License
    This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.