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:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL of the file to share. |
fileName | string | Yes | The 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
text | string | Yes | The 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | Yes | The URL of the file to download. |
fileName | string | Yes | The file name to save as (e.g. "document.pdf"). |
Example:
await startiapp.Share.downloadFile(
"https://example.com/files/document.pdf",
"document.pdf"
);