This plugin opens the phone's share sheet with a text, a link, or both, so people can send a page to any app they have. It handles text and links, not files. Don't confuse it with Receive shares, which lets other apps send content to yours.
Platforms
Included- Android
- iOS
Used by the native builds: Android Build (Native), Android TV and iOS. The Android Build (Web) does not read these settings.
Set it up
Add the plugin
In your project's plugin library, add Native share, then launch a new build.
Connect your share buttons
Inside the app, call
sharerather than your web sharing code.
JavaScript API
const r = await window.saastostore?.share?.({
title: "Trip to Lisbon", // optional
text: "Here is our itinerary",
url: "https://example.com/trips/42",
});
// → { shared: true } the share sheet opened
// → { shared: false, error: "invalid_argument" } url not http or https
// share() with neither text nor url shares the page shown
// in a normal browser: navigator.share?.({ title, text, url })| Argument | Meaning |
|---|---|
title | Optional. The subject of an email, or the title of the sheet |
text | The message |
url | A link, http or https only |
share is a function, not an object. shared: true means the sheet opened, not that something was sent. Your code isn't told which app people chose.
One button for app and web
async function shareTrip(data) {
if (window.saastostore?.share) return window.saastostore.share(data);
if (navigator.share) return navigator.share(data);
await navigator.clipboard.writeText(data.url); // last resort on desktop
}Prompt for AI builders
Prompt for Lovable, Bolt or Base44
My website also runs inside a mobile app. Inside the app, window.saastostore?.share({ title, text, url }) opens the native share sheet. In a normal browser it doesn't exist, and nothing must change.
Make my share buttons call window.saastostore.share when it exists, navigator.share when it doesn't, and copy the link to the clipboard as a last resort. Its promise never rejects, so don't wrap it in a try/catch for the app case.Then launch a new build if you haven't added the plugin yet.