PWA Web Share Target on Android: The Absolute URL Fix

PWA Web Share Target on Android: The Absolute URL Fix
Date
Tags
PWA
Android

Getting the Web Share Target API to work on Android PWAs can be frustrating. Your manifest looks correct, but the app never appears in the share sheet. Here is what finally worked.

Getting the Web Share Target API to work on Android PWAs can be frustrating. Your manifest looks correct, Chrome says the app is installed, but it never appears in the share sheet.

The Problem

After implementing Web Share Target following the Chrome documentation, the PWA installed fine but did not appear as a share option on Android. The manifest had all the required fields:

{
  "name": "myapp",
  "share_target": {
    "action": "/share-target",
    "method": "GET",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url"
    }
  }
}

The Solution

The fix was using an absolute URL for the action field instead of a relative path:

{
  "share_target": {
    "action": "https://myapp.com/share-target",
    "method": "GET",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url"
    }
  }
}

Key Takeaways

  1. Use absolute URLs in the share_target.action field
  2. Completely uninstall and reinstall the PWA after manifest changes - Android caches aggressively

More Articles