Capacitor Full App - Ionic Angular
  • What is Capacitor Full App - Ionic Angular?
  • Understand the Frameworks
  • Template Highlights
  • Setup
    • Initial Setup
  • Running the app
  • Building App on device
  • Deploying app as PWA
    • Deploy PWA on Firebase
  • How to use this template
    • Two way to use this Template
  • Removing a Page / Component
  • Removing a plugin
  • Extra
    • Troubleshooting
    • FAQ
  • Changelog
  • Features
    • Startup Features
      • Layouts
      • Firebase
      • Addons
        • Globalization - Translation
        • Content Loaders
        • Custom Fonts
        • Infinite Scroll
        • Pull to Refresh
        • List Re-ordering
        • Date Time Pickers
        • Settings
      • Login & Signups
      • Sidemenu Layouts
      • Wordpress
        • How to integrate
      • Video Playlist
      • Grid and List Layouts
      • Chat Lists & Chat Pages
    • Pro Features
      • Pro Addons
        • AdMob
          • Integration
          • Setting up Google Admob
        • Music Player
        • Push Notifications
        • Local Notifications
        • Device
        • Clipboard
        • Social Login
        • In-App Browser
        • Sweet Alerts
        • Social Sharing
        • Google Places
        • Google Autocomplete
        • Image Cropper
      • Phaser Game Framework
      • WooCommerce
      • Payment Gateways
    • Others
      • Adding Icon and Splash
Powered by GitBook
On this page
  • Prepare Firebase project for PWA
  • Convert the app into a PWA

Was this helpful?

  1. Deploying app as PWA

Deploy PWA on Firebase

PreviousDeploying app as PWANextTwo way to use this Template

Last updated 5 years ago

Was this helpful?

Prepare Firebase project for PWA

To deploy the app as PWA , we will demonstrate using Firebase hosting.

First create a project on .

Now, in your project directory, run

$ npm install -g firebase-tools

This will install Firebase tools in your project. Now login into Firebase using

$ firebase login

It will redirect you to browser, and authenticate using your google account. Once you are logged in, you can run this command to attach the code to your project.

$ firebase init

It will take you through a list of options for project setup.

This will create a firebase.json file which should look like the following

{
  "hosting": {
    "public": "www",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

Convert the app into a PWA

Finally, build your project into production using

$ ionic build

This will create a production build of your ionic app for PWA deployment. Use Firebase to deploy the app using

$ firebase deploy --only hosting

Whenever you make any changes to the app, make sure you run ionic build before deploying it again on the hosting.

The Firebase console will show the deployment like this

When deploying an app through a hosting service, be aware that HTTPS will be required to take full advantage of Service Workers and features like Geolocation etc.

The two main requirements of a PWA are a and a . While it's possible to add both of these to an app manually.

This will deploy your app on a Firebase url such as where you will see your app running perfectly.

For a more detailed step-by-step guide on PWA deployment, check

For more information on PWA related option in firebase.json , check

Firebase
Service Worker
Web Manifest
https://ionic4fullapp.firebaseapp.com/
this blog
here