Skip to content
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

🐛 [@react-native-firebase/functions] Missing stream implementation for httpsCallable functions #8210

Open
harveyappleton opened this issue Jan 4, 2025 · 3 comments
Labels
Needs Attention type: enhancement Implements a new Feature

Comments

@harveyappleton
Copy link

harveyappleton commented Jan 4, 2025

Hey amazing invertase team! Happy new year!

In Dec 2024, a PR was merged into firebase-js-sdk that allows you to stream responses from Firebase functions which is awesome! I've tried it out on web and it works wonderfully. Would be awesome if this could be implemented in RN Firebase Functions!!! :D

@mikehardy
Copy link
Collaborator

Neat, wasn't aware of that work.

I believe we'll need underlying SDK support prior to us being able to do anything at this layer above them

iOS: firebase/firebase-ios-sdk#14290
Android: firebase/firebase-android-sdk#6602

After that we'll have a fair bit of work here to wrap them and present them in a manner compatible with firebase-js-sdk (or we'd happily accept a PR of course...)

The only thing I can think of in the meantime is that you can actually use the firebase-js-sdk alongside react-native-firebase if you like. It is bundled with react-native-firebase as it is used as a fallback for "other" platform support already internally here. You'll have to initialize an app manually after react-native-app boot just like you do on web, and if you use AppCheck you'll have to set the firebase-js-sdk functions headers with it after fetching it from react-native-firebase/app-check, similar with auth - but those headers shouldn't be too hard to set ?

@harveyappleton
Copy link
Author

harveyappleton commented Jan 5, 2025

I looked into using firebase-js-sdk alongside, but I think the issue is that on React Native, the fetch implementation doesn't support ReadStream. Seems like a common problem. However I found that Expo SDK 52 provides a fetch implementation that is winter cg compliant that supports streaming, so I'm currently updating my app to use that instead and will just manually stream from the firebase function I think :) I can get the Bearer token from firebase auth using getIdToken() so should be all good to go 🙏 would be awesome if the RN firebase supported it but I understand its probably a big chunk of work.

@mikehardy
Copy link
Collaborator

Is a big chunk of work to support it here but most importantly we can't do anything not provided by the underling native android and iOS SDKs, so we are necessarily blocked on them regardless.

Very nifty that it looks like it'll be possible to "weld together" the firebase-js-sdk library support for it while still using react-native-firebase for it's native-only stuff though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Attention type: enhancement Implements a new Feature
Projects
None yet
Development

No branches or pull requests

2 participants