Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Archiving expo-firebase

We started building expo-firebase based off of react-native-firebase in order to attempt to get it to work well within the Expo client. It turned out that there wasn't a good way to do this - the SDK fully expects that there is one binary per app, and the Expo client has multiple apps inside of it. We weren't able to work around this.

If you'd like to use Firebase in the Expo client with the managed workflow, we'd recommend using the Firebase JS SDK. It supports Firebase Realtime Database and Firebase Storage. If you'd like access to the full suite of native firebase tools, we recommend using the bare workflow and react-native-firebase, because we cannot support this in the Expo client currently.

@anka-213
Copy link

anka-213 commented Aug 16, 2019

Oh, this is really sad news. :(

@brentvatne
Copy link
Author

brentvatne commented Aug 18, 2019

@oriharel - indeed, as @nandorojo pointed out you can continue using the JS SDK just fine with managed projects!

@EKoetsjarjan
Copy link

EKoetsjarjan commented Sep 2, 2019

I have upgraded to sdk 34 now (ejected project), anyone tried to use the react-native-firebase using sdk 34?
I need this for offline support

@nandorojo
Copy link

nandorojo commented Sep 2, 2019

@EKoetsjarjan I haven’t ejected so I haven’t used it. That said, I’ve been using a hacky workaround to get Firestore to work offline with Expo and the Firebase JS SDK.

I wouldn’t recommend using this in production yet since I’ve only tested it for about a day so far. That said, it’s been working for me on a managed expo project with firestore’s offline persistence! I’d love your help testing it out.

Here’s a gist:
https://gist.github.com/zwily/e9e97e0f9f523a72c24c7df01d889482

@kuriel-trivu
Copy link

kuriel-trivu commented Sep 12, 2019

is there documentation for Expo Firebase Analytics? (if yes, too hard to find)

@nandorojo
Copy link

nandorojo commented Sep 12, 2019

is there documentation for Expo Firebase Analytics? (if yes, too hard to find)

@kuriel-trivu Firebase Analytics requires react-native-firebase (and thus won't work on a managed expo project). However, I think that it works out-of-the box on Android devices when you're using the firebase JS SDK on a managed expo project. I'm not certain about this, so I don't want to give you the wrong answer, but in my experience, users with Android automatically show up on Firebase Analytics.

Are you able to test out an Android device and see if the same happens for you?

@kuriel-trivu
Copy link

kuriel-trivu commented Sep 12, 2019

I think that was in past, now, Expo sdk 34 has Firebase again in the expo-modules way.

we added firebase as documentation says, but there is no details about how to use Firebase Analytics

https://docs.expo.io/versions/latest/guides/using-firebase/#firebase-sdk-setup
https://docs.expo.io/versions/v34.0.0/guides/using-firebase/#firebase-sdk-setup (v34.0.0)

The docs only mentions Analytics but no more info

image

@StefKors
Copy link

StefKors commented Oct 2, 2019

I was also wondering about this. it mentions analytics without explaining or linking to docs

@nandorojo
Copy link

nandorojo commented Oct 2, 2019

My best guess is that the mention of analytics is from a previous SDK. Expo only supports the firebase JS SDK in a managed project.

@smontlouis
Copy link

smontlouis commented Oct 4, 2019

Analytics web is out. Unfortunately there is an error "document is not defined" when trying to use firebase analytics web in Expo

@StefKors
Copy link

StefKors commented Oct 4, 2019

Yeah I also haven't found a workaround, I ended up going with this package and it works well enough https://github.com/ryanvanderpol/expo-analytics

@brentvatne
Copy link
Author

brentvatne commented Oct 10, 2019

this is a good issue to comment on to discuss firebase analytics in managed expo projects: firebase/firebase-js-sdk#2244

@VanLaerAshley
Copy link

VanLaerAshley commented Dec 9, 2019

This is the end of the expo horizon! :o

@nandorojo
Copy link

nandorojo commented Dec 9, 2019

I know this might not be your ideal answer, but the Segment / expo-segment integration is pretty nice. It does still require a work-around for expo web, including customizing the index.html file and a few other small details, but I'm sure that will get worked out soon enough.

@fparhat-rbi
Copy link

fparhat-rbi commented Feb 14, 2022

If someone wanted to enable Crashlytics or Firebase Performance traces, is the only way via config-plugins and creating new custom expo modules?

Has anyone successfully integrated Crashlytics of Firebase Performance into their expo applications thus far?

@nandorojo
Copy link

nandorojo commented Feb 14, 2022

you can now use react-native-firebase with config plugins, I would do that

@raiss
Copy link

raiss commented Mar 18, 2022

@nandorojo does it mean the expo doesn't need to be ejected?

@nandorojo
Copy link

nandorojo commented Mar 18, 2022

basically. you should learn about expo config plugins and custom dev clients

@daurelien
Copy link

daurelien commented May 18, 2022

@nandorojo
i'm using expo app, added expo-firebase-analytics to get analytics with js sdk. (it work)
I also want to get crashlytics but the expo library (expo-crashlytics) is deprecated ... any issue ?
(i can't eject expo)

@ansh
Copy link

ansh commented Sep 20, 2022

@nandorojo Do you have a config plugin for react-native-firebase?

@nandorojo
Copy link

nandorojo commented Sep 20, 2022

the official library does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment