API in Installation
getInstalledRelatedApps()
Published
The navigator.getInstalledRelatedApps() method reports which apps listed in the calling web app’s manifest related_applications are installed on the device. Use the result to hide an install button or deep-link into a native counterpart. Chrome 84 and Samsung Internet 14 on Android report Play apps and installed PWAs; Chrome 85, Edge 85, and Opera 71 on Windows report UWP apps, and BCD notes that desktop Chrome resolves with an empty array on other platforms. The Chrome capability guide adds that desktop Chrome and Edge 140 or later (Windows, macOS, Linux, ChromeOS) can check a PWA installed in the same scope. Firefox and Safari have not implemented the method (BCD api.Navigator.getInstalledRelatedApps).
Syntax
Section titled “Syntax”const apps = await navigator.getInstalledRelatedApps();The method is [SecureContext], so it is absent on plain HTTP origins, and it is defined only on Navigator, not on WorkerNavigator.
Parameters
Section titled “Parameters”None. The promise fulfils with an array of RelatedApplication dictionaries, one per installed match, each carrying the fields below.
| Field | Type | Description |
|---|---|---|
platform |
string |
The store or ecosystem: "play", "windows", "webapp", "chrome_web_store", "chromeos_play", "f-droid", or "amazon". Copied from the manifest entry. |
id |
string, optional |
The platform-specific identifier (Android package name, UWP package family name). |
url |
string, optional |
The entry’s url from the manifest; for "webapp" it is the related PWA’s manifest URL. |
version |
string, optional |
The installed version where the platform exposes one. |
A match requires both halves of the relationship: the manifest entry on the calling site, and a declaration on the other app pointing back. An Android app does so with Digital Asset Links (an asset_statements entry in its resources that names the website); a UWP app does so with URI handlers; a related PWA does so with a related_applications entry of its own when the caller is inside its scope. For a PWA outside the caller’s scope, the Chrome guide documents assetlinks.json with delegate_permission/common.query_webapk and lists it as Android only.
Exceptions
Section titled “Exceptions”InvalidStateError: the method was called from a document that is not the top-level browsing context, such as an<iframe>, or from a document that is no longer fully active (spec, “getInstalledRelatedApps()” steps 1 and 2).TypeError: thrown synchronously in Firefox and Safari, wherenavigator.getInstalledRelatedAppsisundefined, and on insecure origins in every browser.
An empty array is not an error. It is the result when related_applications is missing or when no listed entry matches an installed app. Entries are matched one by one, so an entry whose back-reference (asset links or URI handler) fails verification, or a PWA that a page outside its scope asks about on desktop, drops out of the result. BCD records that Chrome checks UWP apps on Windows and resolves with an empty array on other platforms, and web.dev lists same-scope PWAs as checkable on desktop from Chrome and Edge 140.
Examples
Section titled “Examples”Both examples assume a manifest whose related_applications names the Android app com.example.app and the site’s own PWA.
Hiding the install button when the Play app is present
Section titled “Hiding the install button when the Play app is present”The manifest declares the relationship; the page checks it before deciding whether to show a web install affordance. Because the method only answers for the first three entries, list the apps that matter most first.
{ "related_applications": [ { "platform": "play", "id": "com.example.app", "url": "https://play.google.com/store/apps/details?id=com.example.app" }, { "platform": "webapp", "url": "https://example.com/manifest.json" } ], "prefer_related_applications": false}async function decideInstallUi() { const apps = await navigator.getInstalledRelatedApps(); if (apps.some((app) => app.platform === 'play')) { installButton.hidden = true; // the native app is already there openInAppLink.hidden = false; // offer the deep link instead } else if (apps.some((app) => app.platform === 'webapp')) { installButton.hidden = true; // this PWA is installed from another browser or profile }}Keep prefer_related_applications at false unless the native app should replace the PWA: when it is true, Chrome’s install UI offers the store listing instead of installing the web app.
Detecting support and falling back to the install prompt
Section titled “Detecting support and falling back to the install prompt”Where the method is absent or returns nothing, the page has no installed-state signal from other apps and should fall back to its normal install flow and to the display-mode check for its own installed state.
async function relatedAppInstalled() { if (!('getInstalledRelatedApps' in navigator)) return false; // Firefox, Safari, HTTP try { const apps = await navigator.getInstalledRelatedApps(); return apps.length > 0; } catch (error) { if (error.name === 'InvalidStateError') return false; // called inside an iframe throw error; }}
if (!(await relatedAppInstalled())) { showInstallAffordance(); // beforeinstallprompt flow, or Share-sheet instructions on iOS}The false branch treats an unavailable result as no related app installed. This can show an install button to a user who already has the native app.
See also
Section titled “See also”- Get Installed Related Apps API specification (wicg.github.io)
- Is your app installed? getInstalledRelatedApps() will tell you! (developer.chrome.com)
- getInstalledRelatedApps() browser support
related_applicationsmanifest member- beforeinstallprompt event
- The N+1 install problem
Specifications
| Specification | Status |
|---|---|
| getInstalledRelatedApps() | WICG draft |
- Legend
- Yes
- Partial
- Flag
- No
- Unknown
| Browser / Platform | Support | Versions | Confidence | Source | Notes |
|---|---|---|---|---|---|
| Chrome (Desktop, Windows)# | Yes | 85 | low | source | 1 |
| Chrome (Android)# | Yes | 84 | low | source | — |
| Edge (Desktop, Windows)# | Yes | 85 | low | source | 2 |
| Samsung Internet# | Yes | 14.0 | low | source | — |
| Opera (Desktop, Windows)# | Yes | 71 | low | source | 3 |
| Firefox (Desktop)# | No | — | low | source | 4 |
| Safari (macOS)# | No | — | low | source | 5 |
| Safari (iOS)# | No | — | low | source | 6 |