In this article, we will learn what is the purpose of manifest.json file in a Progressive web application.
In simple terms, Manifest is a JSON file that allows the users to install a web application to the mobile home screen without needing to go through the Play Store or App Store and install it.
With the help of manifest file, the developer can control the look and feel of the application when it is used through the mobile home screen. For example, developer can display the native like splash screen in their PWA application whenever it is launched, or the icons that are displayed when any native application is installed from the app store and so on. All these things can be controlled and can be implemented through the manifest file. In order to implement these features, we need to use some of the pre-defined properties in our manifest file. Let’s discuss them first and then we will see how each of this works with the help of an example.
- name property – This property is used to display the name or full name of the application in the splash-screen.

- short_name property – This property is used to display the name of the application when user adds an application to the home screen.

- icons property – Whenever we install any native application from the store, short name with the app icon is installed. We can achieve the same thing for a PWA using the icons property. This property expects an array of icon object. Each object is separated by comma. There are three important properties that each icon object expects i.e. src, type, and sizes.
- In src property, pass the full image source.
- In type property, pass the image type i.e. PNG or JPEG.
- In sizes property, pass the image size.
NOTE - Depending on the screen size where the app is installed or added, the icon for the app is used.
- background_color property – This property is used to set the background color of the splash screen.
- orientation – We can control the orientation of our application using this property. We can set it to portrait, or landscape.
- start_url – This property is used to set the default page that will be displayed whenever a user launches the application.
NOTE – If user pins any specific page from a PWA then the default page will not be triggered, meaning it will launch that specific page and not the default page.
- display – In a native application, there is no browser UI but since our application is a web application, so whenever user installs it or add to the home screen, the default browser will also be displayed whenever the application is launched.

If you want to override this rule, set the display property to standalone. It will hide the browser UI.

There are few more properties like theme_color using which you can change the theme or the color of the top bars, or the related_applications property using which you can redirect the user to the native mobile application if you any in the play store.
For more information, please check this link.
Now, let’s see how to create and implement a manifest file but before moving any further please download this starter pack.
Once you have downloaded the pack, extract and open it in vscode, open the terminal using CTRL + ` command and type npm install. You can also right-click on the Package.json file and click on install dependencies.

It will download the dependencies. Once the download is complete, type npm start.

Press Enter and you will see the following –

Open Google Chrome and type – localhost:8081 and press Enter.

At the moment, we don’t have any manifest, so let’s add one in our project.
Inside the public directory, create a new file and name it manifest.json.

In the Index.html page add the reference to the manifest file.
- <link rel="manifest" href="/manifest.json">
Add the following in the manifest.json.
- {
- "name": "Blog and Share your Knowledge",
- "short_name": "Blogger",
- "display": "standalone",
- "start_url": "/index.html"
- }













Jawad BenaouichPosted Jul 12, 2018, 5:51 AM
The progressive web application can work in MVC entity framework ?.
Tony SamDzousaPosted Jan 4, 2018, 9:16 PM
Hi HArpreet, I have created PWA application when i deployed it azure the application is not behaving like pwa, i think the manifest file is not getting into account. Please assist me on how to deploy the application in azure server.
Chris LovePosted Oct 8, 2017, 6:10 PM
Thanks for covering this topic. Good to see more developers getting excited about building progressive web apps. The manifest is not understood that that well or just plain overlooked.
Manav PandyaPosted Oct 4, 2017, 12:40 AM
Nice share sir ......