Comments (20)
@victoriafrench That's an interesting use case that we hadn't envisaged! At the moment, as you've found, the initialisation relies on the GoogleServiceInfo.plist
(iOS) and google-services.json
(Android) files for configuration information.
We can certainly look at supporting custom configuration, we'd just been trying to keep it simple at first. Out of interest, are you needing to connect to multiple projects simultaneously? Or is there only one project active at any one time?
from react-native-firebase.
@Ehesp Thank you for your reply. I somehow managed to get it to work.
I think I wasn't pulling in google-services correctly.
Here are my notes:
###
#Firebase:
###See: console.firebase.google.com
#Download: google-services.json
#Copy and paste it in to /app
Project-level build.gradle (<project>/build.gradle):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:3.0.0'
}
}
App-level build.gradle (<project>/<app-module>/build.gradle):
...
// Add the following to react_native bundle.gradle:
dependencies {
...
compile "com.android.support:appcompat-v7:23.0.1"
...
}
// Add the following to "app" bundle.gradle
dependencies{
...
compile "com.android.support:appcompat-v7:23.0.1"
...
}
// Add to the bottom of the file (app bundle.gradle)
apply plugin: 'com.google.gms.google-services'
from react-native-firebase.
@bakr-baroudi I have updated the docs now, can you look over them again and see if anything has been missed your end: https://github.com/invertase/react-native-firebase/blob/master/docs/firebase-setup.md
from react-native-firebase.
from react-native-firebase.
@bakr-baroudi for clarity, your emulators need to include "Google APIs" once you'd installed via SDK manager:
from react-native-firebase.
Wait a sec I am confused. My iOS app is working fine and I am passing the configuration information in js. The android app is not and is giving the not initialized error.
From what I am reading here, you are saying I can't configure this in js? I HAVE to configure this in JS as the connection information is coming down via json based on the tenant they have authenticated in to. So how do I configure this without hardcoding the app, which is not an option.
from react-native-firebase.
initizlizeApp in RNFirebase doesn't work like the web SDK. The docs need an update, as they don't accept the parameters as shown. You need to add an app on the firebase console, and add the google-services.json
file or plist file (android/ios).
from react-native-firebase.
Could you be more specific?
I added the file and I get the same result
Do I need to also manually add google services?
What else should I do?
from react-native-firebase.
@lobo922 you also need to add google services to your gradle files, otherwise it won't get loaded
from react-native-firebase.
Closing this and making a note to update the android setup docs. @lobo922 if you still have an issue please reply and i'll re-open.
from react-native-firebase.
I'm getting the run-time error:
"Default FirebaseApp is not initialized in this process com.react_native. Make sure to call FirebaseApp.initiailizeApp(Context) first"
from react-native-firebase.
@hynese have you added Firebase to the to the delegate file?
from react-native-firebase.
@hynese any chance you'd be able to review the installation docs on here and let me know if anything was missing based on your experience?
from react-native-firebase.
I am having this issue too. Any updates?
from react-native-firebase.
@bakr-baroudi have you followed the setup instructions from the readme for the platform you're on?
from react-native-firebase.
Hi @Salakar,
Yeah I did follow the setup for iOS works find but Android got an issue.
what do you mean by this:
"There are several ways to setup Firebase on Android. The easiest way is to pass the configuration settings in JavaScript. In that way, there is no setup for the native platform"
-
I have tried to pass the configuration when creating the firebase instance, but did not work for me.
it says : "Default FirebaseApp is not initialized in this process com.react_native. Make sure to call FirebaseApp.initiailizeApp(Context) first". -
I have tried to include google-services.json file under android/app and the other two steps. but did not work. it says: "Google Play Services is required to run this application but no valid installation was found".
from react-native-firebase.
As the firebase documentation says when you setup an Android project, you need to include Google Services in your project:
https://github.com/invertase/react-native-firebase-tests/blob/master/android/build.gradle#L9
https://github.com/invertase/react-native-firebase-tests/blob/master/android/app/build.gradle#L144
from react-native-firebase.
Also @bakr-baroudi
what do you mean by this:
"There are several ways to setup Firebase on Android. The easiest way is to pass the configuration settings in JavaScript. In that way, there is no setup for the native platform"
Where are you reading this from?
EDIT: Mybad. This was pulled from Firestack. Needs changing.
from react-native-firebase.
Thanks guys for replying. @Salakar @Ehesp
I am still getting this issue on Nexus 6A emulator (API 6.0).
Error Msg => "Google Play Services is required to run this application but no valid installation was found".
I change the debugging into my real device (API 7.0) then it works.
from react-native-firebase.
Is there any resolution for this? My iOS app works fine with dynamic configuration through JS but the Android app does not. I need to connect to a different firebase app based on my app's environment configuration and cannot have a static google-services.json file. Why have the firebase.initializeApp() function if it does not work on Android?
from react-native-firebase.
Related Issues (20)
- [React Native][iOS] Consent mode v2
- :fire: You need to update react-native-firebase to get new firebase-ios-sdk that complies with App Store Privacy Manifest requirements HOT 8
- Firestore encountered gRPC-C++ error while upgrading Firebase module to 19.2(iOS) HOT 1
- [π] Documentation Issue - site was down, it is back up HOT 1
- [π₯] Fastlane (iOS) error during compile error on this library HOT 3
- :app debug:x86 failed to configure C/C++ Failed C/C++ configuration. java.lang.IllegalStateException: Failed C/C++ configuration. HOT 3
- [π] AppCheck usage sky rockets after update HOT 2
- [π] Invariant Violation: `new NativeEventEmitter()` requires a non-null argument. HOT 1
- [π] π₯ @react-native-firebase/messaging (Android) - Messaging() gets the wrong ReactContext when there is another Activity instantiated by ReactInstanceManager? HOT 10
- π₯Can't able to run react native android app with @react-native-firebase/perf": "19.1.0 and above HOT 1
- iOS Data Only FCM messages not reaching device HOT 2
- On iOS onMessage event is not firing in Foreground HOT 9
- [π] pod install issue after added library HOT 2
- [π] FirebaseCoreInternal/FirebaseCoreInternal.modulemap' not found after XCode required to download iOS 17.2 HOT 4
- [π] π₯ remote config method `fetchAndActivate()` inconsistent with method `fetch()` and then `activate()` on iOS only
- [π] [ANDROID] Duplicate class com.google.firebase.Timestamp HOT 6
- [π] Bug Report Title - java.lang.RuntimeException: Could not invoke RNFBFirestoreDocumentModule.documentOnSnapshot only android HOT 1
- [π] CocoaPods could not find compatible versions for pod "Firebase/Messaging" HOT 2
- [π] 'FlipperKit/FlipperClient.h' file not found HOT 3
- [π] Bug Report Title - auth()?.currentUser.getIdToken(true) returns null to different users (80% on iOS)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-firebase.