
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
rn-buyme-saver-media
Advanced tools
rn-buyme-saver-media
— это нативный модуль для React Native, позволяющий скачивать файлы из сети и сохранять их в галерею на устройствах iOS и Android. Модуль поддерживает отслеживание прогресса загрузки.
yarn add rn-buyme-saver-media
expo install expo-dev-client
cd ios
pod install
Чтобы модуль мог сохранять файлы в галерею, добавьте следующие разрешения в Info.plist:
<key>NSPhotoLibraryUsageDescription</key>
<string>Требуется доступ к галерее для сохранения изображений</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Требуется разрешение для добавления изображений в галерею</string>
Импортируйте и используйте функцию downloadFileToGallery, передавая URL файла и коллбэк для отслеживания прогресса загрузки.
import React, { useState } from 'react';
import { Button, View, Text } from 'react-native';
import { downloadFileToGallery } from 'rn-buyme-saver-media';
export default function App() {
const [progress, setProgress] = useState(0);
const handleDownload = () => {
downloadFileToGallery("https://example.com/image.jpg", setProgress)
.then(() => alert("Download completed!"))
.catch(error => alert(`Download failed: ${error.message}`));
};
return (
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Button title="Download File" onPress={handleDownload} />
<Text>{`Download Progress: ${progress}%`}</Text>
</View>
);
}
downloadFileToGallery(url: string, onProgress: (progress: number) => void): Promise<void>
url
- URL загружаемого файла.onProgress
- функция коллбэк, вызываемая с текущим прогрессом загрузки в процентах.Для работы на iOS с сохранением файлов в галерею модуль использует PHPhotoLibrary, поэтому требуется разрешение на доступ к фото-библиотеке.
Для вопросов и предложений свяжитесь с нами.
For managed Expo projects, please follow the installation instructions in the API documentation for the latest stable release. If you follow the link and there is no documentation available then this library is not yet usable within managed projects — it is likely to be included in an upcoming Expo SDK release.
For bare React Native projects, you must ensure that you have installed and configured the expo
package before continuing.
Run npx pod-install
after installing the npm package.
FAQs
Downloader any medias with process callback
The npm package rn-buyme-saver-media receives a total of 1 weekly downloads. As such, rn-buyme-saver-media popularity was classified as not popular.
We found that rn-buyme-saver-media demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.