related_applications

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The related_applications manifest member is used to specify one or more applications that are related to your web application. These may be platform-specific applications or Progressive Web Apps.

This enables you to use web APIs like Navigator.getInstalledRelatedApps() to check whether a platform-specific version of your web app, or your web app itself, is already installed on the device.

The related_applications manifest member can also be used with the prefer_related_applications manifest member, which indicates a preference for installing either a related native application or your web application.

Syntax

json
/* Related native application on one platform specified by both url and id */
"related_applications": [
  {
    "platform": "play",
    "url": "https://play.google.com/store/apps/details?id=com.example.app1",
    "id": "com.example.app1"
  }
]

/* Related native application on one platform specified only by id */
"related_applications": [
  {
    "platform": "windows",
    "id": "example.app1"
  }
]

/* Related native applications on two platforms */
"related_applications": [
  {
    "platform": "play",
    "url": "https://play.google.com/store/apps/details?id=com.example.app1",
    "id": "com.example.app1"
  },
  {
    "platform": "amazon",
    "url": "https://www.amazon.com/product/dp/B000XA1000"
  }
]

/* Related web application specified by id */
"related_applications": [
  {
    "platform": "webapp",
    "id": "com.example.app1"
  }
]

Values

An array of objects, each representing a platform-specific application related to the web app. Each object must include a platform property and a url or an id (or both).

platform

A string that identifies the platform on which the application can be found. Examples include amazon (Amazon App Store), play (Google Play Store), windows (Windows Store), and webapp (for Progressive Web Apps). See the complete list of possible platform values.

url Optional

A string that represents the URL at which the platform-specific application can be found. If not specified, an id must be provided.

id Optional

A string with the ID used to represent the application on the specified platform. If not specified, a url must be provided.

Description

A "related application" is the web app itself, when installed as a Progressive Web App (PWA), or native application that provides functionality similar to your web app, often with additional features or better integration with users' devices.

The related_applications manifest member lets you identify the platform-specific applications that are related to your web app. For example, consider you have a native Android app for your product available through the Google Play Store. It provides the same core features as your web app and integrates better with the device's notification system. You can use related_applications to specify this native Android app in your web app's manifest file.

Some key points about the related_applications member include:

Examples

undefined

This example shows how to specify a related native Android app in your web app's manifest file. It uses minimal information to identify the native app available on the Google Play Store:

json
{
  "related_applications": [
    {
      "platform": "play",
      "id": "com.example.app1"
    }
  ]
}

If native versions of your web app are available on both Google Play Store and Windows Store, you can specify them in your web app's manifest file like so:

json
{
  "related_applications": [
    {
      "platform": "play",
      "url": "https://play.google.com/store/apps/details?id=com.example.app1",
      "id": "com.example.app1"
    },
    {
      "platform": "windows",
      "url": "https://apps.microsoft.com/store/detail/example-app1/9WZDNCRFHVJL"
    }
  ]
}

If you want to indicate to browsers that you prefer users to be given the option to install your native app, available on the Google App Store, instead of your web app, you can set prefer_related_applications to true. Browsers may then prompt users to install the native Android app instead of your web app.

json
{
  "prefer_related_applications": true,
  "related_applications": [
    {
      "platform": "play",
      "id": "com.example.app1"
    }
  ]
}

If your web app can be installed as a Progressive Web App (PWA) on the device, for example, to take advantage of features which integrate your PWA into the operating system, you can self-reference your web app in the manifest file:

json
{
  "related_applications": [
    {
      "platform": "webapp",
      "id": "com.example.app1"
    }
  ]
}

Specifications

See also