Problem upload image to firebase storage IOS sdk 39

  1. SDK Version: 39
  2. Platforms(iOS):

I have problems uploading an image to firebase storage with IOS in sdk 39, in android it works perfect, in iOS in sdk 38 and later it worked perfect but now in sdk 39 the file is uploaded to firebase storage but with the application/octet-stream format and 0 bytes.

I use urlToBlob

export const urlToBlob = (url) => {
  return new Promise((resolve, reject) => {
      const xhr = new XMLHttpRequest();
      xhr.onerror = reject;
      xhr.onreadystatechange = () => {
          if (xhr.readyState === 4) {
              resolve(xhr.response);
          }
      };
      xhr.open('GET', url);
      xhr.responseType = 'blob'; // convert type
      xhr.send();
  })
}

Help please!

Hey @jorgem,

Could you see if this is related to react native version .63? Given that it occurred after upgrading from SDK38-39 which went from .62 - .63 I’m thinking that may be the case. I’d recommend searching the rn github repo for issues or discussions.

Cheers,
Adam

I have the exact same issue.

Is this possibly related to React Native 0.63.3 File upload gives "Network error" even if the request gives a 200 response. · Issue #30071 · facebook/react-native · GitHub or React Native 0.62.* [TypeError: Network request failed] on file upload · Issue #28551 · facebook/react-native · GitHub?

Really confused about this.

1 Like

Possibly that is the problem that it does not work, hopefully this will be fixed soon because I have tried many things and it does not work.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.