Static

Since

0.1

Share allows sending a text, an image or a file over other apps on the device. Blacklist works for iOS only.

Hierarchy

Properties

_nativeObject: any

Accessors

  • get nativeObject(): any
  • Returns any

  • set nativeObject(value: any): void
  • Parameters

    • value: any

    Returns void

  • get ios(): TProps["ios"]
  • Returns TProps["ios"]

  • get android(): TProps["android"]
  • Returns TProps["android"]

Methods

  • Executed before everything. This should return nativeObject since it will be assinged directly to nativeObject.

    Parameters

    • Optional params: Partial<Record<string, any>>

    Returns any

  • Parameters

    • Optional params: Partial<Record<string, any>>

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns void

  • Shares a text.

    Example

    import Share from '@smartface/native/share';
    Share.shareText("Hello from '@smartface/native'", myPage, [Share.ios.Twitter, Share.ios.Facebook]);

    Method

    shareText

    Ios

    Android

    Since

    0.1

    Parameters

    • text: string
    • page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>
    • Optional blacklist: string[]

    Returns void

  • Shares an image.

    Example

    import Share from '@smartface/native/share';
    import Image from '@smartface/native/ui/image';

    var image = Image.createFromFile('path to the image');
    Share.shareImage(image, myPage, []);

    Method

    shareImage

    Android

    Ios

    Since

    0.1

    Parameters

    Returns void

  • Shares a file.

    Example

    import Share from '@smartface/native/share';
    import File from '@smartface/native/io/file';

    var file = new File({path: 'path to the file'});
    Share.shareFile(file, myPage, []);

    Method

    shareFile

    Ios

    Android

    Since

    0.1

    Parameters

    • file: FileImpl
    • page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>
    • Optional blacklist: string[]

    Returns void

  • Shares contact.

    Method

    shareContacts

    Ios

    Android

    See

    Contacts Sharing

    Since

    4.2.1

    Parameters

    • params: { items: IContact[]; fileName?: string; page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>; blacklist: string[] }
      • items: IContact[]
      • Optional fileName?: string

        Specifies vCard file name. Defaults to Contacts

      • page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>
      • blacklist: string[]

    Returns void

  • Shares file, image & text.

    Example

    import Share from '@smartface/native/share';
    import File from '@smartface/native/io/file';

    var myPage = this; // in page scope
    var file = new File({
    path: 'assets://yourFile.pdf'
    });
    var image = Image.createFromFile("images://smartface.png");
    var text = "Hello from Smartface";
    Share.share({ items: [text, file, image] , page: myPage, blacklist: [Share.ios.Twitter, Share.ios.Facebook]});

    Method

    share

    Ios

    Android

    See

    Multiple Sharing

    Since

    4.0.2

    Parameters

    • params: { items: any[]; page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>; blacklist: string[] }
      • items: any[]
      • page: IPage<"load" | "dismissComplete" | "dismissStart" | "dismissCancel" | "hide" | "show" | "orientationChange" | "safeAreaPaddingChange", MobileOSProps<PageIOSParams, PageAndroidParams>, any>
      • blacklist: string[]

    Returns void

Generated using TypeDoc