I'm following the example here to store and retrieve an image blob on Firestore, but I have trouble retrieving:
const firebase_blob = doc.get('img');
const uint8_array = firebase_blob.toUint8Array();
The following error appears when I run the code:
firebase_blob.toUint8Array is not a function at UserManager.js:91:59
Using console.log(firebase_blob);
I get the following:
{
"_byteString": {
"binaryString": "ÿØÿà\u0000\u0010JFIF\u0000\u0001\u0001\u0000\u0000\u0001\u0000\u0001\u0000\u0000ÿâ\u0001ØICC_PROFILE\u0000\u0001\u0001\u0000\u0000\u0001È\u0000\u0000\u0000\u0000\u00040\u000(...truncated)"
}
}
Can anyone kindly point out my mistake? Is the toUint8Array deprecated in favour of another function? Thanks in advance.