I am trying to mimic native share functionality shown below in React Native using the Share
in react-native
, specifically I need the ability to Save to Files
, Markup
and Print
.
The following share sheet is what is shown on React Native when using the following code.
const shareButtonPressed = () => {
Share.share({
message: 'Share PDF',
url: selectedDocument.url,
title: 'Title',
});
};
2
Answers
Considering that you want to share a pdf URL.
Here is the work around that you can use to handle the use case you have mentioned in the question.
Conclusion
The below code will give desired output
If you are using Expo then you can use the below method from expo-sharing.
https://docs.expo.dev/versions/latest/sdk/sharing/
and expo file system:
https://docs.expo.dev/versions/latest/sdk/filesystem/