question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for Web Share Target API

See original GitHub issue

It is possible to register a PWA (WebAPK) as share target (it happens automatically if share_target is specified in manifest.json) but it does not seem to be supported in TWA at the moment. This is a huge bummer for us because share data with our PWA/TWA is a central feature.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:22 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
flunderperocommented, Apr 27, 2020

Two and a half months and a PR later and still there is no progress on this. We cannot release our app, because its main benefit is being a share-target, which works absolutely great as a PWA. But our customers demand an app (and we want to have the benefits of being listed in the Play Store).

I am a bit baffled that we seem to be the only ones desperately missing this feature.

I don’t want to sound pi**ed or blame anyone for anything, but I need a perspective going forward. Had I known 2.5 months ago, that support for WebShareTargetV2 is not coming for months, I would have decided to use Cordova or write a wrapper on my own.

It would be great if you could just give me feedback, whether you plan to work on this in the next couple of weeks. I would love to help out (more), but my knowledge of the inner workings of this project and androidx is at its limit. 😃

1reaction
AliasIOcommented, Dec 17, 2020

@andreban I noticed that share_target.params.files is required in manifest.json (I believe this should be optional). Adding that, shareTarget is correctly added to twa-manifest.json using @bubblewrap/cli@1.8.0.

However, after installing the app on my phone I still can’t share to it. When I install the app as a PWA from Chrome, it works fine.

{
  "packageId": "com.wappalyzer.twa",
  "host": "twa.wappalyzer.com",
  "name": "Wappalyzer",
  "launcherName": "Wappalyzer",
  "display": "standalone",
  "themeColor": "#32067C",
  "navigationColor": "#000000",
  "navigationColorDark": "#000000",
  "navigationDividerColor": "#000000",
  "navigationDividerColorDark": "#000000",
  "backgroundColor": "#FFFFFF",
  "enableNotifications": false,
  "startUrl": "/?standalone=true",
  "iconUrl": "https://twa.wappalyzer.com/images/logo/icon_512.png",
  "maskableIconUrl": "https://twa.wappalyzer.com/images/logo/icon_mask_512.png",
  "monochromeIconUrl": "https://twa.wappalyzer.com/images/logo/icon_white_512.png",
  "splashScreenFadeOutDuration": 300,
  "signingKey": {
    "path": "***",
    "alias": "android"
  },
  "appVersionName": "1",
  "appVersionCode": 1,
  "shortcuts": [],
  "generatorApp": "bubblewrap-cli",
  "webManifestUrl": "https://twa.wappalyzer.com/manifest.json",
  "fallbackType": "customtabs",
  "features": {},
  "alphaDependencies": {
    "enabled": false
  },
  "enableSiteSettingsShortcut": true,
  "isChromeOSOnly": false,
  "shareTarget": {
    "action": "https://twa.wappalyzer.com/",
    "params": {
      "title": "title",
      "text": "text",
      "url": "url",
      "files": []
    }
  },
  "orientation": "default",
  "appVersion": "1"
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Receiving shared data with the Web Share Target API
The Web Share Target API allows installed web apps to register with the underlying operating system to receive shared content.
Read more >
Web Share API - MDN Web Docs - Mozilla
The Web Share API provides a mechanism for sharing text, links, files, and other content to an arbitrary share target selected by the...
Read more >
Web Share Target API - W3C on GitHub
This specification defines an API that allows websites to declare themselves as web share targets, which can receive shared content from ...
Read more >
194593 – Add support for Web Share Target API
Adding support for the `Share Target API` will help democratize access to this share capability for apps of all sizes (even those who...
Read more >
Web Share Target API Explained - GitHub
Web Share Target is a proposed web API to enable a web site to receive shared data from other sites or apps. Many...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found