Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@ankipro/react-native-file-open
Advanced tools
Library empowers to seamlessly detect and handle external file openings on iOS. You can allowing your app to respond when users attempt to open files from other apps or external sources.
yarn add @ankipro/react-native-file-open
npx pod-install
Sorry but, you need to modify your ios/AppDelegate.m
.
At the top of the file, import the RNFileOpen right before '@implementation AppDelegate':
@import RNFileOpen;
Within your existing didFinishLaunchingWithOptions method, add the following method:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Add me --- \/
NSURL *_Nullable launchURL = [launchOptions valueForKey:UIApplicationLaunchOptionsURLKey];
if (launchURL) {
[[FileOpeningModule sharedInstance] markFileOpened:launchURL];
}
// Add me --- /\
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
At the end of the file add the following:
// Add me --- \/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(nonnull NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options
{
[[FileOpeningModule sharedInstance] markFileOpened:url];
return YES;
}
// Add me --- /\
@end
If you want the app to appear in suggestions when you open certain files on your device, you need to add the desired extensions in the project info.
For example adding .zip
extension looks like:
import FileOpening from '@ankipro/react-native-file-open';
// ...
useEffect(() => {
const onFileOpened = (uri: string) => {
console.log('Opened file: ', uri);
};
FileOpening.getOpenedFileURL().then(onFileOpened).catch(() => {});
const subscription = FileOpening.addListener((data) => {
onFileOpened(data.url);
});
return () => {
subscription.remove();
};
}, []);
For more information see example.
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
Made with create-react-native-library
FAQs
React Native file opening listener for iOS
The npm package @ankipro/react-native-file-open receives a total of 58 weekly downloads. As such, @ankipro/react-native-file-open popularity was classified as not popular.
We found that @ankipro/react-native-file-open demonstrated a healthy version release cadence and project activity because the last version was released less than 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.