【发布时间】:2022-08-12 09:23:34
【问题描述】:
当我尝试在 android 上使用 firebase uploadBytes 时,它可以正常工作,但在 ios 上,只要视频文件大于 2 mb,应用程序就会崩溃且没有日志 我尝试使用uploadBytesResumable,甚至尝试将我的firebase版本降级到版本8,但还没有解决方案
const fetchImage = await fetch(localUri);
const imageBlob = await fetchImage.blob();
const storage = getStorage();
const upload = ref(storage, \'path_to_sotrage\');
const uploadTask = await uploadBytesResumable(upload, imageBlob);
return await getDownloadURL(uploadTask.ref);
-
uploadBytesResumable()不会返回 Promise,因此 await 在那里是不必要的。您是否尝试过使用uploadBytes()代替? -
你找到解决方案了吗?在这里面临同样的问题 & android 崩溃甚至没有上传。
标签: javascript firebase react-native expo firebase-storage