kathawala / expo-file-dl

Download files to any folder and notify the user while the download is happening and when the download finishes
MIT License
44 stars 8 forks source link

No download complete notification when downloading a pdf #17

Open stevechang-emoney opened 3 years ago

stevechang-emoney commented 3 years ago

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);