I am trying to upload a video to firebase storage on iOS. Android works just fine. Here is the code causing it (there are comments in the code to show when it crashes). Also, I am using my own iPhone to test this, not a simulator.
export const mediaUpload = async (imageObject) => {
// getting blob from a local file a user uploads from ImagePicker
const blob = await fetch(imageObject[0].uri);
const blobObject = await blob.blob();
// creating reference path in storage
const fileRef = ref(storage, `${auth.currentUser.uid}/videos/${uuid.v4()}`);
// ----- no crash so far... -------
// this is the issue line
const attemptToUpload = await uploadBytes(fileRef, blobObject);
// ------> APP CRASHES
}
On Android, this works with both images and videos. On iOS, images work but videos will crash the app completely. The blob type is video/quicktime. Why does uploadBytes method crash the app?
EDIT: The answer was that Firebase v9 seems to not be compatible with Expo on dealing with video uploads to storage 100%. Even android hangs on video uploads without any error message I found out. The way I solved this was to go back to version Firebase 8.10.0. This works 100%.