user1998096
user1998096

Reputation: 55

expo-file-dl downloading images on iOS not working with permissions

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. Can anyone help?

Upvotes: 0

Views: 358

Answers (1)

user1998096
user1998096

Reputation: 55

Turns out it was a difference between running the app through the expo locally and a live version of the app. Once I deployed it to testflight things worked as expected

Upvotes: 0

Related Questions