This topic has been a dead end since we are all still waiting for the Blob support. Not until recently the good Expo dev @wcandillon managed to come up with a work around (see here ā¦ show some love for the man). The approach worked very well with me on iOS how ever on Android I get this Network request failed error:
and this is how the code looks like:
uploadImage(uri, name, type) {
return new Promise(async (resolve, reject) => {
const body = new FormData();
body.append("picture", {
uri: uri,
name,
type: type
});
await fetch(`${cloudFunctionApiUrl}`, {
method: "POST",
body,
headers: {
Accept: "application/json",
"Content-Type": "multipart/form-data"
}
}).then(async() => {
console.log("getting download url now ...");
const url = await firebase.storage().ref(path).getDownloadURL();
resolve(url);
}).catch(error => {
reject(error);
});
});
}
So any clue why this is happening ?