Working with Manifest Files
Learn how to use the manifest file.
We'll cover the following...
A manifest file provides information about an app in JSON format. It is usually in the root folder of an application. The following code snippet shows how to add a manifest file named manifest.json
to the index.html
file:
Press + to interact
<link href="manifest.json" rel="manifest" />
Here is a sample manifest file that includes many possible fields:
Press + to interact
{"dir": "ltr","lang": "en","name": " 5-Day Weather Forecast","short_name": "Weather","scope": "/","display": "standalone","start_url": "./","background_color": "transparent","theme_color": "transparent","description": "This is a 5-day weather forecast.","orientation": "any","related_applications": [],"prefer_related_applications": false,"icons": [{"src": "icon-512.png","type": "image/png","sizes": "512x512"}],"url": "https://bweweather.azurewebsites.net","screenshots": []}
As mentioned earlier, a manifest file must include the name of the application and at least one icon. Beyond that, everything else is optional, although is it highly recommended that we include description
, short_name
, and start_url
as a minimum.