Questions tagged [firebase]

Firebase is a serverless platform for unified development of applications for mobile devices and for the web.

firebase
Filter by
Sorted by
Tagged with
832 votes
10 answers
275k views

Is it safe to expose Firebase apiKey to the public?

The Firebase Web-App guide states I should put the given apiKey in my Html to initialize Firebase: // TODO: Replace with your project's customized code snippet <script src="https://www.gstatic....
farmio's user avatar
  • 9,193
572 votes
31 answers
614k views

How to handle notification when app in background in Firebase

Here is my manifest: <service android:name=".fcm.PshycoFirebaseMessagingServices"> <intent-filter> <action android:name="com.google.firebase.MESSAGING_EVENT&...
Parth Patel's user avatar
  • 6,618
490 votes
28 answers
418k views

No Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp() in Flutter and Firebase

I am building a Flutter application and I have integrated Firebase, but I keep getting this error when I click on a button either to register, login, or logout. I have seen other people have asked the ...
Kennedy Owusu's user avatar
432 votes
6 answers
181k views

What's the difference between Cloud Firestore and the Firebase Realtime Database?

Google just released Cloud Firestore, their new Document Database for apps. I have been reading the documentation but I don't see a lot of differences between Firestore and Firebase DB. The main ...
Francisco Durdin Garcia's user avatar
422 votes
9 answers
368k views

Convert Promise to Observable

I am trying to wrap my head around observables. I love the way observables solve development and readability issues. As I read, benefits are immense. Observables on HTTP and collections seem to be ...
Krishnan Sriram's user avatar
352 votes
32 answers
528k views

firestore: PERMISSION_DENIED: Missing or insufficient permissions

I am getting the Error gettingdocuments.com.google.firebase.firestore.FirebaseFirestoreException: PERMISSION_DENIED: Missing or insufficient permissions. for the below code on else statement ...
SUHAS REKHU's user avatar
  • 3,593
346 votes
21 answers
74k views

API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()

Using Android Studio 3.3 Canary 11 with the gradle plugin version 3.3.0-alpha11. It throws the following error when trying to sync gradle WARNING: API 'variant.getExternalNativeBuildTasks()' is ...
Jude Fernandes's user avatar
330 votes
31 answers
290k views

Firebase onMessageReceived not called when app in background

I'm working with Firebase and testing sending notifications to my app from my server while the app is in the background. The notification is sent successfully, it even appears on the notification ...
Cyogenos's user avatar
  • 3,579
330 votes
30 answers
286k views

Cloud Firestore collection count

Is it possible to count how many items a collection has using the new Firebase database, Cloud Firestore? If so, how do I do that?
Guilherme Torres Castro's user avatar
315 votes
9 answers
155k views

What is Firebase Firestore 'Reference' data type good for?

I'm just exploring the new Firebase Firestore and it contains a data type called reference. It is not clear to me what this does. Is it like foreign key? Can it be used to point to a collection ...
Jürgen Brandstetter's user avatar
310 votes
7 answers
631k views

How can I solve the error 'TS2532: Object is possibly 'undefined'?

I'm trying to rebuild a web app example that uses Firebase Cloud Functions and Firestore. When deploying a function I get the following error: src/index.ts:45:18 - error TS2532: Object is possibly '...
Constantin Beer's user avatar
306 votes
8 answers
265k views

Query based on multiple where clauses in Firebase

{ "movies": { "movie1": { "genre": "comedy", "name": "As good as it gets", "lead": "Jack Nicholson&...
47d_'s user avatar
  • 3,527
296 votes
57 answers
282k views

Flutter and google_sign_in plugin: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)

The dialog (Google form) for the credentials is opened successfully, but after I fill my credentials I'm getting this error. I followed the instructions from here. Created a Firebase project, enabled ...
Boyan Bozhidarov's user avatar
294 votes
6 answers
256k views

Firebase Storage How to store and Retrieve images [closed]

How to store and view images on firebase?
dogger's user avatar
  • 2,965
293 votes
19 answers
174k views

FirebaseInstanceIdService is deprecated

Hope all of you aware of this class, used to get notification token whenever firebase notification token got refreshed we get the refreshed token from this class, From following method. @Override ...
Uttam Panchasara's user avatar
289 votes
7 answers
92k views

How do I solve: Error: Failed to list Firebase projects. See firebase-debug.log for more info

So I'm minding my own business trying to initializing a Firebase project in my Angular app when all of the sudden I'm hit with this error: Error: Failed to list Firebase projects. See firebase-debug....
Patrick's user avatar
  • 12.9k
273 votes
6 answers
119k views

Difference Between Firestore Set with {merge: true} and Update

In Cloud Firestore there are three write operations: add() set() update() In the docs it says that using set(object, { merge: true }) will merge the given object with the existing document. The same ...
ZuzEL's user avatar
  • 13.2k
272 votes
34 answers
258k views

Enabling CORS in Cloud Functions for Firebase

I'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is that I can't access the function I wrote through an AJAX request. I get the "No 'Access-Control-...
Andrey Pokrovskiy's user avatar
270 votes
12 answers
112k views

Separate dev and prod Firebase environment

I am considering using Firebase as MBaaS, however I couldn't find any reliable solution to the following problem: I would like to set up two separate Firebase environments, one for development and one ...
racs's user avatar
  • 4,054
266 votes
13 answers
189k views

Failed to resolve: com.google.firebase:firebase-core:9.0.0

I get the following error while upgrading a firebase project from old domain to new google firebase domain. Failed to resolve: com.google.firebase:firebase-core:9.0.0 I followed the steps ...
Manish Patiyal's user avatar
262 votes
13 answers
184k views

Flutter: CocoaPods's specs repository is too out-of-date to satisfy dependencies

Current, I was trying to add firebase_core: ^0.5.0+1 and firebase_crashlytics: ^0.2.1+1 packages in my flutter project with the latest versions, It works without any trouble in Android but in iOS, it ...
user avatar
257 votes
17 answers
447k views

How can I send a Firebase Cloud Messaging notification without use the Firebase Console?

I'm starting with the new Google service for the notifications, Firebase Cloud Messaging. Thanks to this code https://github.com/firebase/quickstart-android/tree/master/messaging I was able to send ...
David Corral's user avatar
  • 4,115
230 votes
19 answers
98k views

How do I structure Cloud Functions for Firebase to deploy multiple functions from multiple files?

I would like to create multiple Cloud Functions for Firebase and deploy them all at the same time from one project. I would also like to separate each function into a separate file. Currently I can ...
jasonsirota's user avatar
  • 4,031
222 votes
9 answers
116k views

How to protect firebase Cloud Function HTTP endpoint to allow only Firebase authenticated users?

With the new firebase cloud function I've decided to move some of my HTTP endpoint to firebase. Everything works great... But i have the following issue. I have two endpoints build by HTTP Triggers (...
spaceMonkey's user avatar
  • 4,545
215 votes
9 answers
112k views

Transferring an app to another Firebase account

I have a few apps under my personal firebase account for testing, but now need to transfer an app to a client's account for billing purposes. Is this possible? Thanks!
patrickkidd's user avatar
  • 2,977
214 votes
12 answers
449k views

NullInjectorError: No provider for AngularFirestore

I'm learning Angular looking for help in fixing the error: I'm following this link : https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md to create a angular small app with ...
Developer's user avatar
  • 2,429
211 votes
26 answers
199k views

How do I convert a Firestore date/Timestamp to a JS Date()?

I am trying to convert the below date to a javascript Date() object. When I get it back from the server, it is a Timestamp object, Screenshot from Firebase Firestore console: When I try the ...
blueether's user avatar
  • 3,826
211 votes
28 answers
162k views

Google Firestore: Query on substring of a property value (text search)

I am looking to add a simple search field, would like to use something like collectionRef.where('name', 'contains', 'searchTerm') I tried using where('name', '==', '%searchTerm%'), but it didn't ...
tehfailsafe's user avatar
  • 3,343
210 votes
11 answers
214k views

type 'List<dynamic>' is not a subtype of type 'List<Widget>'

I have a snippet of code which I copied from Firestore example: Widget _buildBody(BuildContext context) { return new StreamBuilder( stream: _getEventStream(), builder: (context, ...
Arash's user avatar
  • 12.1k
209 votes
11 answers
197k views

Firebase messaging, where to get Server Key?

Firebase allows us to send notification messages via our own application by making POST request. This tutorial, gives to us instructions how to make this request. However, there is Authorization ...
Mr.D's user avatar
  • 7,693
203 votes
27 answers
144k views

Get Download URL from file uploaded with Cloud Functions for Firebase

After uploading a file in Firebase Storage with Functions for Firebase, I'd like to get the download url of the file. I have this : ... return bucket .upload(fromFilePath, {destination: ...
Valentin's user avatar
  • 5,569
203 votes
12 answers
189k views

How to add Document with Custom ID to firestore

Is there any chance to add a document to firestore collection with custom generated id, not the id generated by firestore engine?
Harvey Dent's user avatar
  • 2,103
201 votes
5 answers
46k views

HTTP Error: 401 while setting up firebase cloud functions for android project

I`m trying to set up firebase functions, but I get an error after running firebase init. Error: HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login ...
M.Ali's user avatar
  • 9,365
199 votes
17 answers
100k views

Google Firestore - How to get several documents by multiple ids in one round-trip?

I am wondering if it's possible to get multiple documents by a list of ids in one round trip (network call) to the Firestore database.
Joon's user avatar
  • 9,594
198 votes
13 answers
293k views

Where can I find the API KEY for Firebase Cloud Messaging?

I am trying to figure out how the new version of GCM or Firebase Cloud Messaging works so I moved one of my projects to the new Firebase console, If I did not have the API KEY or I want to create a ...
Nissar's user avatar
  • 2,420
196 votes
5 answers
139k views

Firebase Storage and Access-Control-Allow-Origin

I'm trying to download files from Firebase Storage through a XMLHttpRequest, but Access-Control-Allow-Origin is not set on the resource, so it's not possible. Is there any way to set this header on ...
Blacksad's user avatar
  • 15.1k
193 votes
35 answers
196k views

CocoaPods could not find compatible versions for pod "Firebase/CoreOnly"

I've updated my flutter package to the last versions and now IOS doesn't work anymore. When I try to update the pods it shows this error: [!] CocoaPods could not find compatible versions for pod "...
Luca Panteghini's user avatar
193 votes
18 answers
221k views

How to update an "array of objects" with Firestore?

I'm currently trying Firestore, and I'm stuck at something very simple: "updating an array (aka a subdocument)". My DB structure is super simple. For example: proprietary: "John Doe", sharedWith: [...
charnould's user avatar
  • 2,735
192 votes
24 answers
79k views

Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has permission to access it

I tried running firebase deploy like I have always done but came across this Error: Error: Failed to get Firebase project project-name. Please make sure the project exists and your account has ...
uber's user avatar
  • 4,663
190 votes
11 answers
122k views

Firestore query subcollections

I thought I read that you can query subcollections with the new Firebase Firestore, but I don't see any examples. For example I have my Firestore setup in the following way: Dances [collection] ...
Nelson.b.austin's user avatar
189 votes
9 answers
118k views

How do I switch apps from the firebase cli?

This seems like something which should be pretty easy to do, but for whatever reason, I'm being defeated. I'm trying to use the firebase-tools CLI to interact with my database. I'm able to login ...
wvm2008's user avatar
  • 2,934
185 votes
23 answers
340k views

Plugin with id 'com.google.gms.google-services' not found

I have followed this link to integrate ads in my app. But it shows this error: This is my build.gradle: apply plugin: 'com.android.application' apply plugin: 'com.google.gms.google-services' android ...
Lakshmi's user avatar
  • 1,891
183 votes
7 answers
64k views

Firebase cloud functions is very slow

We're working on an application that uses the new firebase cloud functions. What currently is happening is that a transaction is put in the queue node. And then the function removes that node and puts ...
Stan van Heumen's user avatar
181 votes
9 answers
71k views

How to deploy some functions to Cloud Functions for Firebase without affecting some other functions?

When I run firebase deploy --only functions it reads the index.js file and updates all functions exported from that file. If on the previous deploy there was a function named a, and in the current ...
Randy Sugianto 'Yuku''s user avatar
180 votes
8 answers
137k views

MongoDB vs Firebase [closed]

MongoDB vs Firebase What are some quantitative advantages of using Firebase over MongoDB? (not opinions) I know that Firebase is a cloud-based service with its own API, but I feel like Mongo may give ...
itsclarke's user avatar
  • 8,762
176 votes
25 answers
136k views

Execution failed for task ':app:mapDebugSourceSetPaths'. > Error while evaluating property 'extraGeneratedResDir' of task

I've checked this answer: https://stackoverflow.com/a/34834772/13519865 It tells us to remove this line apply plugin: 'com.google.gms.google-services' Removing the line as asked completes the build, ...
Cyber Avater's user avatar
  • 1,885
174 votes
10 answers
184k views

Why is my React component is rendering twice?

I don't know why my React component is rendering twice. So I am pulling a phone number from params and saving it to state so I can search through Firestore. Everything seems to be working fine except ...
Raul Sanchez's user avatar
  • 1,809
171 votes
22 answers
116k views

Didn't find class "com.google.firebase.provider.FirebaseInitProvider"?

I am getting the below exception on app launch. java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find ...
WISHY's user avatar
  • 11.6k
171 votes
20 answers
140k views

Unable to get provider com.google.firebase.provider.FirebaseInitProvider

I am testing the new Crash tool: https://firebase.google.com/docs/crash/ After going through the steps, the app launches and it crashes saying: 05-18 17:28:18.870 28743 28743 E AndroidRuntime: java....
Macarse's user avatar
  • 92.5k
171 votes
3 answers
79k views

What Does WidgetsFlutterBinding.ensureInitialized() do?

I am trying to use the Firebase package with the below line of code. I really want to know what this line of code actually does? The official documentation didn't help me much. Can someone explain me, ...
Abhishek Ghimire's user avatar

1
2 3 4 5
2867