starti.app
API Reference

Share

Share files and text through the native OS share sheet, or download files directly to the device.

Access: startiapp.Share

For a practical guide to sharing content from your app — see Share Content.

Methods

shareFile(url: string, fileName: string): Promise<void>

Opens the native share sheet with a file downloaded from the given URL. The user can then share it via any installed app (email, messaging, etc.).

Parameters:

ParameterTypeRequiredDescription
urlstringYesThe URL of the file to share.
fileNamestringYesThe file name to use when sharing (e.g. "report.pdf").

Example:

await startiapp.Share.shareFile(
  "https://example.com/files/report.pdf",
  "report.pdf"
);

shareText(text: string): Promise<void>

Opens the native share sheet with the given text content.

Parameters:

ParameterTypeRequiredDescription
textstringYesThe text content to share.

Example:

await startiapp.Share.shareText("Check out this link: https://example.com");

downloadFile(url: string, fileName: string): Promise<void>

Downloads a file from the given URL and saves it to the device's default download folder.

Parameters:

ParameterTypeRequiredDescription
urlstringYesThe URL of the file to download.
fileNamestringYesThe file name to save as (e.g. "document.pdf").

Example:

await startiapp.Share.downloadFile(
  "https://example.com/files/document.pdf",
  "document.pdf"
);

On this page