docs.rodeo

MDN Web Docs mirror

prefer_related_applications

{{QuickLinksWithSubpages("/en-US/docs/Web/Progressive_web_apps/Manifest/Reference")}} {{SeeCompatTable}} 

The prefer_related_applications manifest member is used to provide a hint to browsers whether to prefer installing native applications specified in the related_applications manifest member over your web application.

Syntax

/* Boolean values */
"prefer_related_applications": true
"prefer_related_applications": false

Values

Examples

Specifying preference for installing your web app

Consider a scenario where you have both a web app and native apps for your product available on Google Play Store and Windows Store. If you want to offer related native apps as options but prefer users to install your web app, you can set it up in your manifest file as shown below. Browsers will promote your web app for installation. The native apps will still be available as alternatives.

{
  "prefer_related_applications": false,
  "related_applications": [
    {
      "platform": "play",
      "id": "com.example.hiking-app"
    },
    {
      "platform": "windows",
      "url": "https://apps.microsoft.com/detail/9nqx6sv74srz"
    }
  ]
}

To encourage users to install your native Android hiking app from Google Play Store in preference to the web app, you can configure your web app’s manifest file as shown below.

{
  "prefer_related_applications": true,
  "related_applications": [
    {
      "platform": "play",
      "id": "com.example.hiking-app"
    }
  ]
}

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN