GithubHelp home page GithubHelp logo

kathawala / expo-file-dl Goto Github PK

View Code? Open in Web Editor NEW
44.0 44.0 8.0 764 KB

Download files to any folder and notify the user while the download is happening and when the download finishes

License: MIT License

TypeScript 100.00%
expo expo-file-download expo-notifications expo-sdk file-download package react-native react-native-file-download typescript

expo-file-dl's Introduction

Hi ๐Ÿ‘‹, I'm Farhan

A full-stack developer, works a lot with Ruby, React & React Native. I'm a big fan of type-challenges and fancy Typescript types / function signatures

kathawala

  • ๐Ÿ”ญ Iโ€™m currently working at Shopify

  • ๐Ÿ“’ I maintain Gerbera (mobile app) and expo-file-dl among other things

  • ๐ŸŒฑ Iโ€™m currently learning ruby/rails, hasura, svelte, flutter

  • ๐Ÿ‘จโ€๐Ÿ’ป All of my projects are available at https://github.com/kathawala

  • โœ๏ธ I post short guides and how-tos on my site: https://farhansayshi.com

  • ๐Ÿ’ฌ Ask me about react (native), expo, django(-rest-framework), express, serverless framework, terraform, ansible, AWS

  • ๐Ÿ“ซ How to reach me [email protected]

  • โšก Fun fact my name means "happy" ๐Ÿ˜„

Blog posts:

Connect with me:

4293195 https://www.farhansayshi.com/post/index.xml

Languages and Tools:

arduino aws azure babel bash blender c cplusplus css3 d3js django docker express figma flask gcp git graphql haskell html5 hugo java javascript jest linux nginx nodejs photoshop postgresql puppeteer python react reactnative redux typescript vuejs

kathawala

ย kathawala

expo-file-dl's People

Contributors

kathawala avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

expo-file-dl's Issues

Unable to resolve module @unimodules/core

Am I missing something? I am running a managed Expo app, there is some information about react-native-unimodules but that is for Bare Expo and React Native apps.

iOS Bundling failed 5544ms
Unable to resolve module @unimodules/core from .../node_modules/expo-file-dl/node_modules/expo-media-library/build/MediaLibrary.js: @unimodules/core could not be found within the project or in these directories:
node_modules/expo-file-dl/node_modules/expo-media-library/node_modules
node_modules/expo-file-dl/node_modules
node_modules

Check sdk 40 compatibility

Have heard reports that scheduleNotificationAsync needs a seconds parameter in the trigger property as opposed to just the channelId. Need to test this out

downloadToFolder function on Android versions > 8

Hello,

I don't have a physical Android device that's capable of installing newer versions of Android OS beyond 8. For Android 8 and 7, the downloadToFolder function works as expected:

await downloadToFolder(uri, filename, 'my-apps-folder', channelId);

The 'my-apps-folder' gets created inside Android OS's Documents folder and the file is found. However, client testing with a newer Android OS doesn't see 'mp-apps-folder' inside Documents and it's no where to be found (and no downloaded file either). I'm wondering if anyone has any insights and experiences on any differences in behaviour between different versions of Android OS's.

For now my code is using default Notification settings, if that matters in any way.

Thanks

Media Permission is required to do this operation (IOS)

Hi,
I'm fairly new to iOS development and I'm using expo-file-dl 2.0.0 to download remote files on expo 41.0.0. It works great with non image file types but when I try to pull images I get the Error: MEDIA_LIBRARY permission is required to do this operation error.

My code looks like this:

let hasAccess = await MediaLibrary.getPermissionsAsync();
if(hasAccess.accessPrivileges.toLowerCase() == "all") {
  await downloadToFolder(
    "https://upload.wikimedia.org/wikipedia/commons/thumb/f/fe/Watermark_sample.jpg/1599px-Watermark_sample.jpg", 
    "test.jpg", 
    "Download", 
    "DownloadInfo");
}

I have verified that "hasAccess" is 'all' both in app and in the app settings. I've been looking at this for 2 days now and I can't figure out what I"m missing. Any idea what's going on?

Large file downloading error

I have simply download your example code and try to download a movie with a direct mp4 link. The download starts very Nice. but After some time its give me an error. Here is the error code

[Unhandled promise rejection: Error: timeout]
at node_modules/react-native/Libraries/BatchedBridge/NativeModules.js:103:50 in promiseMethodWrapper
at node_modules/@unimodules/react-native-adapter/build/NativeModulesProxy.native.js:15:23 in moduleName.methodInfo.name
at http://192.168.1.6:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:144143:105 in downloadAsync$
at http://192.168.1.6:19000/node_modules/expo/AppEntry.bundle?platform=android&dev=true&hot=false&minify=false:144128:41 in downloadAsync
at node_modules/expo-file-dl/dist/index.js:100:74 in downloadFile
at node_modules/expo-file-dl/dist/index.js:98:0 in downloadFile
at node_modules/expo-file-dl/dist/index.js:125:54 in downloadToFolder

Can you please fix this problem in your npm package... I will be very thankful to you.

Update the library to work with Expo 41 / Android R

Android R / Expo 41 / the latest version of Expo Go all expect the user to use Android SAF on devices that are using Android R.

Currently the library doesn't support this (and in fact will not work at all on Android with the current Expo Go on an Android R phone).

I need to add the ability to use SAF functions (https://docs.expo.io/versions/latest/sdk/filesystem/?redirected#storage-access-framework--android-only-) if the device is detected as having Android 11.

This does not affect iOS.

No download complete notification when downloading a pdf

Hi,

I'm using the downloadtofolder function to download several file types on IOS. When I download images, everything works great but when I download non image files, the notifications don't seem to be quite right. When I initiate the download, a notification pops up saying that I'm initiating the download and opens up the save file dialog which is all good. But when the download completes, I don't get a notification. Any idea what I'm doing wrong?

My code:

 let customNotifInput: EDFL_NotificationContent = {
    downloading: { title: "Downloading", body: 'Downloading ', color: '#06004a' },
    finished: { title: "Complete", body: 'downloaded successfully', color: '#004a00' },
    error: { title: "Error", body: 'Error downloading', color: '#810002' }
  };

 let notificationOptions: EFDL_Options = { notificationType: {notification: "custom"}, notificationContent: customNotifInput }

 let url = "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf";
 
 await downloadToFolder(url, "test.pdf", "Download", channelId, notificationOptions);

Make notification optional

Make displaying downloading and download completed notification optional. For some us that would like to implement custom notification in our apps.

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.