Gathering detailed insights and metrics for @yupio/react-native-share-menu
Gathering detailed insights and metrics for @yupio/react-native-share-menu
Gathering detailed insights and metrics for @yupio/react-native-share-menu
Gathering detailed insights and metrics for @yupio/react-native-share-menu
A module for React Native that adds your app to the share menu of the device
npm install @yupio/react-native-share-menu
Typescript
Module System
Node Version
NPM Version
Swift (47.47%)
Java (21.85%)
JavaScript (14.4%)
Objective-C (11.96%)
Ruby (3.2%)
Starlark (1.12%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
688 Stars
129 Commits
251 Forks
58 Watchers
22 Branches
185 Contributors
Updated on Jun 02, 2025
Latest Version
6.0.0
Package Id
@yupio/react-native-share-menu@6.0.0
Unpacked Size
62.11 kB
Size
16.97 kB
File Count
32
NPM Version
8.11.0
Node Version
16.14.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
Add your app as a target for sharing from other apps and write iOS Share Extensions in React Native.
1npm i --save react-native-share-menu
At the command line, in the ios directory:
1pod install
At the command line, in the project directory:
1react-native link
1import React, { useState, useEffect, useCallback } from "react"; 2import { AppRegistry, Text, View, Image, Button } from "react-native"; 3import ShareMenu, { ShareMenuReactView } from "react-native-share-menu"; 4 5type SharedItem = { 6 mimeType: string, 7 data: string, 8 extraData: any, 9}; 10 11const Test = () => { 12 const [sharedData, setSharedData] = useState(null); 13 const [sharedMimeType, setSharedMimeType] = useState(null); 14 15 const handleShare = useCallback((item: ?SharedItem) => { 16 if (!item) { 17 return; 18 } 19 20 const { mimeType, data, extraData } = item; 21 22 setSharedData(data); 23 setSharedMimeType(mimeType); 24 // You can receive extra data from your custom Share View 25 console.log(extraData); 26 }, []); 27 28 useEffect(() => { 29 ShareMenu.getInitialShare(handleShare); 30 }, []); 31 32 useEffect(() => { 33 const listener = ShareMenu.addNewShareListener(handleShare); 34 35 return () => { 36 listener.remove(); 37 }; 38 }, []); 39 40 if (!sharedMimeType && !sharedData) { 41 // The user hasn't shared anything yet 42 return null; 43 } 44 45 if (sharedMimeType === "text/plain") { 46 // The user shared text 47 return <Text>Shared text: {sharedData}</Text>; 48 } 49 50 if (sharedMimeType.startsWith("image/")) { 51 // The user shared an image 52 return ( 53 <View> 54 <Text>Shared image:</Text> 55 <Image source={{ uri: sharedData }} /> 56 </View> 57 ); 58 } 59 60 // The user shared a file in general 61 return ( 62 <View> 63 <Text>Shared mime type: {sharedMimeType}</Text> 64 <Text>Shared file location: {sharedData}</Text> 65 </View> 66 ); 67}; 68 69const Share = () => { 70 const [sharedData, setSharedData] = useState(""); 71 const [sharedMimeType, setSharedMimeType] = useState(""); 72 73 useEffect(() => { 74 ShareMenuReactView.data().then(({ mimeType, data }) => { 75 setSharedData(data); 76 setSharedMimeType(mimeType); 77 }); 78 }, []); 79 80 return ( 81 <View> 82 <Button 83 title="Dismiss" 84 onPress={() => { 85 ShareMenuReactView.dismissExtension(); 86 }} 87 /> 88 <Button 89 title="Send" 90 onPress={() => { 91 // Share something before dismissing 92 ShareMenuReactView.dismissExtension(); 93 }} 94 /> 95 <Button 96 title="Dismiss with Error" 97 onPress={() => { 98 ShareMenuReactView.dismissExtension("Something went wrong!"); 99 }} 100 /> 101 <Button 102 title="Continue In App" 103 onPress={() => { 104 ShareMenuReactView.continueInApp(); 105 }} 106 /> 107 <Button 108 title="Continue In App With Extra Data" 109 onPress={() => { 110 ShareMenuReactView.continueInApp({ hello: "from the other side" }); 111 }} 112 /> 113 {sharedMimeType === "text/plain" && <Text>{sharedData}</Text>} 114 {sharedMimeType.startsWith("image/") && ( 115 <Image source={{ uri: sharedData }} /> 116 )} 117 </View> 118 ); 119}; 120 121AppRegistry.registerComponent("Test", () => Test); 122AppRegistry.registerComponent("ShareMenuModuleComponent", () => Share);
Or check the "example" directory for an example application.
$ npm version <minor|major|patch> && npm publish
Sponsored and developed by Meedan.
iOS version maintained by Gustavo Parreira.
No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
Found 13/25 approved changesets -- score normalized to 5
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
50 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More