Questions tagged [firebase]

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

Filter by
Sorted by
Tagged with
836 votes
10 answers
277k 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,233
573 votes
31 answers
616k 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,628
490 votes
28 answers
422k 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
434 votes
6 answers
182k 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
424 votes
9 answers
371k 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
354 votes
32 answers
534k 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,613
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
333 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,609
330 votes
30 answers
287k 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
316 votes
9 answers
156k 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
313 votes
7 answers
637k 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
298 votes
57 answers
286k 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
295 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
294 votes
6 answers
257k 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
7 answers
93k 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
  • 13k
276 votes
6 answers
120k 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.3k
272 votes
34 answers
260k 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
272 votes
12 answers
113k 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,084
267 votes
13 answers
187k 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
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
257 votes
17 answers
448k 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
223 votes
9 answers
117k 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,555
217 votes
9 answers
113k 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,997
214 votes
12 answers
451k 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
213 votes
28 answers
163k 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,363
212 votes
26 answers
201k 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,836
210 votes
11 answers
215k 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
210 votes
11 answers
199k 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,723
204 votes
12 answers
190k 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,113
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
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,435
199 votes
13 answers
295k 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,430
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,614
198 votes
5 answers
141k 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
195 votes
35 answers
199k 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
194 votes
24 answers
80k 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,713
193 votes
18 answers
222k 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,747
191 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
119k 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,944
185 votes
23 answers
344k 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
9 answers
72k 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
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
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,782
179 votes
26 answers
140k 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,925
177 votes
10 answers
187k 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,839
173 votes
3 answers
80k 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
173 votes
31 answers
321k views

Error: No Firebase App '[DEFAULT]' has been created - call Firebase App.initializeApp()

I have a firebase database linked up to two apps, one being an iOS app and another being a web app coded in node.js which is a basic algorithm that sets data to the database. When ever i am running ...
Samuel Aubin's user avatar
  • 1,763
172 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

1
2 3 4 5
2868