Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
react-native-open-doc
Advanced tools
Open files stored on device for preview - Android and iOS.
Pick files using native file pickers for iOS and Android (UIDocumentPickerViewController / Intent.ACTION_OPEN_DOCUMENT)
Share files on Android (for iOS use the react-native Share.share({ url: selectedUri }) api).
$ npm install react-native-open-doc --save
$ react-native link react-native-open-doc
Note that the authorities value should be <your package name>.provider
, for example:
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.mydomain.provider"
android:exported="false"
android:grantUriPermissions="true">
...
</provider>
Libraries
➜ Add Files to [your project's name]
node_modules
➜ react-native-open-doc
and add RNCOpenDoc.xcodeproj
libRNCOpenDoc.a
to your project's Build Phases
➜ Link Binary With Libraries
Cmd+R
)<android/app/src/main/java/[...]/MainActivity.java
import com.capriza.reactlibrary.RNCOpenDocPackage;
to the imports at the top of the filenew RNCOpenDocPackage()
to the list returned by the getPackages()
methodandroid/settings.gradle
:
include ':react-native-open-doc'
project(':react-native-open-doc').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-open-doc/android')
android/app/build.gradle
:
implementation project(':react-native-open-doc')
import RNCOpenDoc from 'react-native-open-doc';
RNCOpenDoc.open(pathToFile);
RNCOpenDoc.share(pathToFile);
RNCOpenDoc.pick(null, (error, files) => {
if (error) {
console.log(`error in RNCOpenDoc.pick ${error}`);
}
else if (files) {
this.handleSelectedFiles(files);
}
});
files
is an array of objects with the following properties:
fileName
(string) e.g. "foo.html"fileSize
(number) (iOS only) File size in bytesmimeType
(string) (iOS only) e.g. "text/html"uri
(string) Example (iOS): "file:///private/var/mobile/Containers/Data/Application/.../foo.html"FAQs
React Native module for openning documents
The npm package react-native-open-doc receives a total of 5 weekly downloads. As such, react-native-open-doc popularity was classified as not popular.
We found that react-native-open-doc demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.