I have an app which displays pictures from a server. I allow the user to long click on it to save it to the gallery. It works perfectly for small pictures on Android and IOS, but if the image size is bigger than a few Ko, I have this crash :

"Error: failed to load URL "

if (Platform.OS === "android") {
        RNFetchBlob.config({
          fileCache: true,
          appendExt: "jpg"
        })
          .fetch("GET", url, {
            Authorization: "Bearer " + token
          })
          .then(res => {
            CameraRoll.saveToCameraRoll(res.path()) //saveImageWithTag
              .then(() => {
                console.log("Photo added to camera roll!" + res.path())
                this.toggleSaveModal(false)
              })
              .catch(err => {
                console.log("err:", err)
                this.toggleSaveModal(false)
              })
          })
      } else {
        CameraRoll.saveToCameraRoll(url)
          .then(() => {
            this.toggleSaveModal(false)
          })
          .catch(err => {
            console.log("err:", err)
            this.toggleSaveModal(false)
          })
      }

0 Answers