-
Notifications
You must be signed in to change notification settings - Fork 24.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Data Blobs? #16034
Comments
Any response on this? Curious on how to create new data blobs in RN |
I am experiencing the same issue. Curious to know the work around. |
Same thing here. Was just trying to upload some files with Firebase Storage in a react native app, used RNFS to get the actual file, all works fine, but when I actually try and upload it, this errors pops up, and I guess Firebase uses this type of blob ( out of base64 strings ) as well .. |
same thing in here, it used to work with the previous react native version. |
@Eduardjs I have the same error. Did you find a solution? |
Hello gents, and Yes. I have worked around the lack of support for Blob in RN by using RNFetchBlob ( react-native-fetch-blob ). Getting const imageRef = storage
.ref( user.objectId )
.child( `messages/${conversation.roomId}/${Date.now()}.jpg` )
Blob.build( RNFetchBlob.wrap( URI_FROM_PHOTO_PICKER ), { type: 'application/octet-stream' })
.then( blob => {
imageRef
.put( blob, { contentType: 'application/octet-stream' })
.then( () => {
blob.close()
return imageRef.getDownloadURL()
})
}) Hope it helps :) |
@Eduardjs thanks for your help! Unfortunately, this does not work in my situation. We use Expo and I can not add I guess the only thing we can do is use some cloud function that will get base64 string, convert it into byteArray and store in Firebase. |
@serhiipalash Hello. Sorry to hear that. Firebase also supports |
also using expo and still no solution this issue is blocking us to release our app to production |
@Eduardjs Hi! I tried |
+1 |
I will write here solution with cloud function if it will work. |
Yea, because firebase uses **Blob** support from the browser … hence the need for a polyfill ( which RNFetchBlob provides ). Only solution for you is to find a polyfill that works, for Blob support, in Expo ( can’t help with that though ).
As for waiting for an improvement, don’t get your hopes up :)
… On 17 Oct 2017, at 23:26, Serhii Palash ***@***.***> wrote:
@Eduardjs <https://github.com/eduardjs> Hi! I tried putString last week and it does not work.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#16034 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AHWwZRfyaTVzE8NuV2DkgajexJMzYSBtks5stRt6gaJpZM4Pd40v>.
|
😄 The speed of adding new features in RN is very slow compared to the normal React world. It was a big surprise for me when I started working with RN. |
Getting same issue on a 64-Bit Android emulator. Using 32-Bit now an everything works as expected. |
RNFB is also not really an option for many projects even when they're not using Expo. That library has some critical issues regarding how it handles things from document providers on Android: |
Hei Daniel! I can only hope for official support then. I only deal with an
iOS app, so I’m covered
…On Thu, 19 Oct 2017 at 04:52, Daniel Friesen ***@***.***> wrote:
@Eduardjs <https://github.com/eduardjs> thanks for your help!
Unfortunately, this does not work in my situation. We use Expo and I can
not add response-native-fetch-blob to the project.
RNFB is also not really an option for many projects even when they're not
using Expo.
That library has some critical issues regarding how it handles things from
document providers on Android:
wkh237/react-native-fetch-blob#525
<wkh237/react-native-fetch-blob#525>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#16034 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AHWwZSFrzW9Db1k5_jxjipwUK5VAFr1jks5strlmgaJpZM4Pd40v>
.
|
As far as I know there's an open PR to add this functionality: #11573 |
@serhiipalash did you end writing that cloud function? |
@serhiipalash did you end writing that cloud function? i'm realy stuck .Thank You |
@serhiipalash @karimraoudy I wrote a cloud function for this: https://medium.com/@wcandillon/uploading-images-to-firebase-with-expo-a913c9f8e98d |
@wcandillon I did saw your post but didn't understand how to implant in my code. thank you for your reply |
I'm experiencing this too, tried base64, base64url and blob with no luck |
@wcandillon Thank you very much for sharing your solutions. Worked like a charm for me! |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
All
Steps to Reproduce
Create a React Native application and attempt to create a data blob, error is created saying a "Blob can only be created from another Blob".
Expected Behavior
A data blob is created the same as it works for all other JavaScript execution environments
Actual Behavior
Support for data blobs appears broken with an error message of "Data blob can only be created from another blob"
Reproducible Demo
You may make use of my library Hamsters.js to see this in action, simply follow the instructions to import the library into a React Native application. A user of my library has reported this bug to me and I would really like to see support for my library brought back as it relies on data blob creation for efficient operation, the alternatives are bad for performance.
austinksmith/Hamsters.js#40
The text was updated successfully, but these errors were encountered: