Text and links
open({ title?, message?, url? }) resolves true when the user shared.
For links to a profile, build the URL with userPageUrl, not window.location.
Files on the device
uri must be a file the shell can read, such as a nativeUri returned by the camera.
Generated documents
shareContent shares a file your page built itself, such as an export or a PDF. Inside a shell, <a download> and window.print() do nothing, so this is how a user gets the file out.
string
required
The file contents.
'utf8' | 'base64'
default:"'utf8'"
Use
base64 for binary files.string
required
Name the shell saves it under.
string
Content type.
string
Share sheet title (Android).
{ shared?, error? }, with error being not_available or failed. It answers not_available outside a shell and in shell versions that predate it, so always keep a browser download path.
Outside a shell,
open resolves false and shareFile resolves error: 'not_available'. In a browser, use navigator.share or a download link.