Git Product home page Git Product logo

girish54321 / react-native-ios-files-app-save Goto Github PK

View Code? Open in Web Editor NEW
5.0 2.0 1.0 4.23 MB

a React Native package that allows you to easily download any file from the internet and save it to your Files app on Android and iOS devices. With a simple and intuitive API, react-native-ios-files-app-save makes it easy to integrate file downloading functionality into your React Native projects

License: MIT License

Java 0.21% JavaScript 0.03% Ruby 0.05% Swift 0.06% C 0.01% Objective-C 0.04% Objective-C++ 0.02% TypeScript 99.59%
android download-manager filesave ios native-module react-native development-tools file-downloading mobile-development open-source

react-native-ios-files-app-save's Introduction

react-native-ios-files-app-save

react-native-ios-files-app-save is a React Native package that allows you to easily download any file from the internet and save it to your Files app on Android and iOS devices.

App Screenshot

Installation

To install react-native-ios-files-app-save, use npm or yarn

npm

npm install react-native-ios-files-app-save

yarn

yarn add react-native-ios-files-app-save

Android AndroidManifest.xml

<uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

iOS info.plist

<key>LSSupportsOpeningDocumentsInPlace</key>
  <true/>
<key>UIFileSharingEnabled</key>
  <true/>

Usage

To use react-native-ios-files-app-save simply import the startDownloadAppSave function and call it with the URL of the file you want to download:

import { startDownloadAppSave } from 'react-native-ios-files-app-save';

export default function App() {
  const demoDownload = () => {
    if (!hasPermission) {
      //* Handle Permission
      return;
    }
   let options: FileSaveOptions = {
      url: "YOUR URL,
      fileName: "name.pdf,
      isBase64: false
    }
    startDownloadAppSave(options).then((res) => {
      const fileSaveSuccess = res as FileSaveSuccess;
      console.log(fileSaveSuccess);
      console.log(fileSaveSuccess.message);
    }).catch((error) => {
      console.log("error", error);
    })
  };

  return (
    <View style={styles.container}>
      <Text onPress={demoDownload}>{'Start Download'}</Text>
    </View>
  );
}

Contributing

Contributions are welcome! If you have any issues, ideas, or suggestions for react-native-ios-files-app-save, feel free to open an issue or submit a pull request on Github.

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

If you find my work useful, please consider supporting me by buying me a coffee!

Your support helps me continue to develop and maintain this package.

Thank you!

Buy Me A Coffee

react-native-ios-files-app-save's People

Contributors

girish54321 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tuanduc2904

react-native-ios-files-app-save's Issues

File Name

Add Support for create file with custom File name.

MyFile.pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.