Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native and iOS share button

I am trying to access iOS' share button where you can share content to all services, including messages etc... Any idea how I could do this? Thanks

like image 785
dylan Avatar asked Sep 02 '25 03:09

dylan


2 Answers

You now have a simple Share API in react-native.

import { Share } from "react-native"

Share.share(
      {
        title: "a title",
        message: "some message",
        // or
        url: imageReference
      },
      (options)
    );

See http://facebook.github.io/react-native/docs/share.html

like image 156
MoOx Avatar answered Sep 04 '25 21:09

MoOx


You can achieve this out of the box in React Native - just use ActionSheetIOS.showShareActionSheetWithOptions. See the documentation here.

like image 34
David Avatar answered Sep 04 '25 22:09

David