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.

@mgscreativa

This comment has been minimized.

Copy link

mgscreativa commented Mar 15, 2019

So, if I use react-native-firebase I don't need to use react-native link or similar?

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented Mar 19, 2019

you do need to link it, yes. the firebase native sdk is only supported in bare workflow projects. you can use the firebase js sdk in managed workflow projects.

@EKoetsjarjan

This comment has been minimized.

Copy link

EKoetsjarjan commented Mar 21, 2019

@brentvatne, what is the difference between bare and managed vworkflow projects?

@karlodegrano

This comment has been minimized.

Copy link

karlodegrano commented Mar 21, 2019

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.

Hello @brentvatne, did you mean if I want to use other Firebase tools such as Crashlytics, I would not be able to use ExpoKit?

@christanfoden

This comment has been minimized.

Copy link

christanfoden commented Mar 22, 2019

@brentvatne, what is the difference between bare and managed vworkflow projects?

https://docs.expo.io/versions/latest/introduction/managed-vs-bare/

@redpandatronicsuk

This comment has been minimized.

Copy link

redpandatronicsuk commented Mar 26, 2019

Are you still maintaining the modules for ExpoKit users? I used to use react-native-firebase before and put a lot of work into porting the app over to use expo-firebase instead. Please don't tell me that was all wastes efforts and I need to migrate back to react-native-firebase now?

@redpandatronicsuk

This comment has been minimized.

Copy link

redpandatronicsuk commented Mar 27, 2019

@karlodegrano you can still use react-native-firebasse in the ExpoKit project. I have done that before and it worked fine.If you haven't integrated expo-firebase yet, skip that and go straight for react-native-firebase. For users who used react-native-firebase before however and got rid of it in favour for expo-firebase, I don't know what the best answer is as it is not clear whether the Expo team just gave up on adding native Firebase to managed Expo apps or whether they are dropping expo-firebase as a project. In case they are dropping expo-firebase, I suppose the suggestion is to switch back to react-native-firebase, so when you have to update your app in the future you are not held back by expo-firebase. If anyone knows what the future direction for expo-friebase is, please leave a comment here so I can plan ahead. Thanks

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented Mar 28, 2019

@redpandatronicsuk

If anyone knows what the future direction for expo-friebase is, please leave a comment here so I can plan ahead. Thanks

we don't plan on maintaining it, sorry :( the idea was to build expo-firebase so that we could integrate it into the expo client and use it in expokit projects if needed to eject. given that 1) it didn't work out in the client and 2) we are migrating from expokit towards a less monolithic ejected project workflow ('bare' workflow), we can no longer justify the resources for creating and maintaining a library that will effectively serve the same purpose as react-native-firebase.

@karlodegrano

did you mean if I want to use other Firebase tools such as Crashlytics, I would not be able to use ExpoKit?

as far as i know that should all work just fine! we just will not be supporting libraries like https://www.npmjs.com/package/expo-firebase-app which are expo-specific wrappers around firebase native apis

@chrisdrackett

This comment has been minimized.

Copy link

chrisdrackett commented May 1, 2019

does anyone know if firebase auth works in a expo project using the JS SDK?

@CricketLaChica

This comment has been minimized.

Copy link

CricketLaChica commented May 2, 2019

@chrisdrackett

does anyone know if firebase auth works in a expo project using the JS SDK?

Yup, it does!

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented May 3, 2019

here's a tutorial that uses firebase auth: https://www.youtube.com/watch?v=6stMRtgQopk

@oriharel

This comment has been minimized.

Copy link

oriharel commented May 13, 2019

@brentvatne - just to be clear - If I use managed workflow, can my crashes report to Firebase Crashlytics? Is the integration just a matter of creating a project in Firebase and adding the keys to app.json?

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented May 13, 2019

on android you can integrate with crashlytics by adding the key to app.json but this is not currently available on ios for managed expo apps

@koenpunt

This comment has been minimized.

Copy link

koenpunt commented May 18, 2019

How is this going to work now that Google is sunsetting Google Analytics for mobile, recommending users to switch to Firebase?

@daniocean

This comment has been minimized.

Copy link

daniocean commented May 19, 2019

I second @koenpunt. The JavaScript SDK doesn't support analytics and I'm not sure Google will add them in. Does this mean we'll have to switch to an alternative analytics provider in order to keep using Expo?

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented May 19, 2019

hello! it's unclear at this point what google means by this. i expect you should be able to continue using google analytics just fine because you're using the js sdk and not the native ios/android sdks.

@koenpunt

This comment has been minimized.

Copy link

koenpunt commented May 19, 2019

it's unclear at this point what google means by this

What do you think is unclear about their plan?

We want to remind you that starting this October we will begin sunsetting this older style of Google Analytics for mobile apps reporting and the Google Analytics Services SDK. We are investing our resources in the latest style of app reporting in Google Analytics that works in conjunction with Firebase – Google’s integrated app developer platform. As such, the following will take place:

• Starting October, we will begin to decommission properties that were identified at the time of our first notice as receiving data exclusively from the Google Analytics Services SDK.
• Data collection and processing for such properties will stop October 31, 2019.
• Reporting access through our UI and API access will remain available for these properties’ historical data until January 31, 2020.
• After our service is fully turned down in February, 2020, these properties will no longer be accessible via our Google Analytics UI or API, and their data will be removed from Google Analytics servers. You will receive further notification as these deadlines approach.

We want to give you plenty of time to make the transition and start collecting new data using the Firebase SDK, since your historical data will no longer be available. Our latest solution, however, is even more intuitive and includes free and unlimited event reporting to meet the needs of app-centric businesses. We’ve invested heavily to make this solution best-in-class, with new features and capabilities, such as a more robust Audience builder and multi-dimensional report filtering, rolling-out continually. Additionally, our offering is closely integrated with other Google products and features to help grow your app business like Crashlytics, Google Ads, AdMob and Remote Config. For more information, visit the Help Center for an overview and list of available features.

@cmacdonnacha

This comment has been minimized.

Copy link

cmacdonnacha commented May 25, 2019

I have auth and firestore working just fine using the JS SDK, there's been no need to use any other package. However, I can't find any info on how to get firebase dynamic links to work. Can this be done with Expo?

@jellevdvliet

This comment has been minimized.

Copy link

jellevdvliet commented Jun 1, 2019

@cmacdonnacha how did you get firestore working?

@cmacdonnacha

This comment has been minimized.

Copy link

cmacdonnacha commented Jun 1, 2019

@jellevdvliet I just followed the docs available here: https://firebase.google.com/docs/firestore

What you want is the web sdk.

@vpontis

This comment has been minimized.

Copy link

vpontis commented Jun 9, 2019

Thanks for the update here Brett!

I am using expo-firebase on an Expo SDK 32 version. I'm going to try bumping the Expo SDK to 33 and keeping expo-firebase. We will see how this goes...

I plan on switching from expo-firebase to react-native-firebase in the future.

@cmacdonnacha

This comment has been minimized.

Copy link

cmacdonnacha commented Jun 11, 2019

@vpontis, I'm not 100% sure but in order to use react-native-firebase I'm pretty sure you need to eject.

@vpontis

This comment has been minimized.

Copy link

vpontis commented Jun 12, 2019

@vpontis, I'm not 100% sure but in order to use react-native-firebase I'm pretty sure you need to eject.

Yes, you do. You also need to eject for the old expo-firebase package.

@hotaryuzaki

This comment has been minimized.

Copy link

hotaryuzaki commented Jun 17, 2019

i Almost spending 3 weeks to setup RN Firebase in expokit, but still.
I do not get any solution until now.
Error to error comes through.

My problem now,
If im using npm start,
when apps starts showing error:
RN Firebase core module was not found natively on android, ...
(but i can confirm i already setup correctly)

If I'm using react-native run-android,
build success but then got error:
java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=host.exp.exponent/.MainActivity } from null (pid=20229, uid=2000) not exported from uid 10274

is there any one who had same problem?

@yashlinmaistry

This comment has been minimized.

Copy link

yashlinmaistry commented Jul 19, 2019

@vpontis

I am using expo-firebase on an Expo SDK 32 version. I'm going to try bumping the Expo SDK to 33 and keeping expo-firebase. We will see how this goes...

I plan on switching from expo-firebase to react-native-firebase in the future.

I did it pan out for you?

I'm moving our expokit app to 33 this weekend. Do you recommend we also move to react-native-firebase?

@brentvatne

This comment has been minimized.

Copy link
Owner Author

brentvatne commented Jul 19, 2019

@koenpunt - i imagine that the web google analytics js sdk, which people are using with expo currently, will continue to work. it seems that they will just sunset the google analytics native mobile sdks. but i do not work for google so i cannot say, feel free to reach out to them and update us here

@oriharel

This comment has been minimized.

Copy link

oriharel commented Aug 11, 2019

Btw @brentvatne, I suggest you remove this doc -
https://docs.expo.io/versions/latest/guides/using-firebase/
right?

@nandorojo

This comment has been minimized.

Copy link

nandorojo commented Aug 12, 2019

Btw @brentvatne, I suggest you remove this doc -
https://docs.expo.io/versions/latest/guides/using-firebase/
right?

These docs are for the firebase JS SDK which works with managed expo projects.

@anka-213

This comment has been minimized.

Copy link

anka-213 commented Aug 16, 2019

Oh, this is really sad news. :(

@brentvatne

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

kuriel-trivu commented Sep 12, 2019

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

@nandorojo

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

StefKors commented Oct 2, 2019

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

@nandorojo

This comment has been minimized.

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.

@bulby97

This comment has been minimized.

Copy link

bulby97 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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Owner 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

This comment has been minimized.

Copy link

VanLaerAshley commented Dec 9, 2019

This is the end of the expo horizon! :o

@nandorojo

This comment has been minimized.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.