html2app • JS Bridge
    Preparing search index...

    Variable ShareConst

    Share: {
        text(text: string): Promise<MessageResponse<{}>>;
        uri(uri: string | URL): Promise<MessageResponse<{}>>;
    } = ...

    Share plugin for opening the native share sheet.

    Type Declaration

    • text: function
      • Open the share sheet with a text message.

        Parameters

        • text: string

          The text to share. Must not be empty or only whitespace.

        Returns Promise<MessageResponse<{}>>

        ok: true after the share sheet has closed, whether or not the user shared. ok: false if the input is invalid or the share sheet could not be opened.

    • uri: function
      • Open the share sheet with a link.

        Parameters

        • uri: string | URL

          An absolute URI such as https://flutter.dev, or a URL object.

        Returns Promise<MessageResponse<{}>>

        ok: true after the share sheet has closed, whether or not the user shared. ok: false if the URI is invalid or the share sheet could not be opened.

    Backed by the share_plus Flutter plugin. Requires the share plugin to be enabled in the app configuration. Only text and URIs are supported. Input is validated before sending, so invalid values return { ok: false } without a round trip to Flutter. The share sheet is shown centered on the screen on iPad.

    import { Share } from '@yandeu/js-bridge/lib/plugins/share.js'

    await Share.text('Check this out')
    await Share.uri('https://flutter.dev')