Questions tagged [firebase]

26261 questions
1

votes
1

answer
1.3k

Views

Swift Query Into Firebase Firestore Nested Array

I have nested data that I'd like to display in a tableView. My data is structured like so... /users /userid name: 'John' age: 23 /likedPosts 0:post1 1:post2 For the tableview I'd like to display these posts (which have their own collection of data). In order to do that I need to... 1) Get the coun...
pmanning
1

votes
1

answer
620

Views

Trigger a PubSub message from Cloud Functions

Firebase docs mention a straightforward way of subscribing to a pubSub topic. Does Cloud Functions or Firebase Admin SDK provide a way to publish pubSub events or we are limited to what is described in Google Cloud Platform docs: https://cloud.google.com/pubsub/docs/publisher#pubsub-publish-message...
Łukasz Patecki
1

votes
1

answer
330

Views

Firebase rules and validations for update existing data

I have a data structure as following: { 'users' : { '31J59dq1clZ3inHMzoopiigsEg63' : [ { 'name' : 'Lanchana', 'timestamp' : 1516916245423, 'uid' : '31J59dq1clZ3inHMzoopiigsEg63', 'userEmail' : '*****@gmail.com', 'total-stars' : 123 } ] } } and fire rules as following: { 'rules': { 'users': { '$uid'...
lanchana gupta
1

votes
2

answer
1k

Views

How to save a text with tabs and new lines in Firestore and get it back intact?

Realtime database used to add \n, \t, etc but it doesn't seem to be the case for Firestore. this might be something basic I'm missing. Either way, how can I save something like this and get it back with new lines and tabs intact: value: 'test newline another line' currently, I get it back like th...
TheeBen
1

votes
1

answer
2.2k

Views

readFileSync from an URL for Twitter media - node.js

I need to use an URL to import a media to Twitter. But I can't figure out how to use an URL without having to download the image, save it temporarily on the server and deleted after... I'm using Google Cloud to store the images that's why I can't access it directly. That's what I'm trying to do : va...
Phil
1

votes
2

answer
254

Views

Can't get permission to firebase database IOS

I can't get permission to database. In xcode console I am getting this message: [Firebase/Database][I-RDB038012] Listener at /skelbimai failed: permission_denied So I went to firebase database, then Rules and changed like this: service cloud.firestore { match /databases/{database}/documents { matc...
1

votes
1

answer
260

Views

Firebase deploy get ID with onCreate for push notifications

I'm creating an iOS app and sending notifications. I'm trying to get an id from Firebase but the code below doesn't work. exports.pushNotifications = functions.database.ref('/message/{messageId}') .onCreate((snap, context) => { var messageId = event.params.uid; . . . I tried this code from the docum...
coonie
1

votes
1

answer
665

Views

Firebase doesn't deploy. ERROR SELF SIGNED CERTIFICATE

I've been following the tutorial on how to apply Dialoglflow to an app... https://developers.google.com/actions/dialogflow/first-app#deploy_the_fulfillment On the section BUILD FULFILLMENT, the error occurs. I've installed the latest node.js, python and installed npm on the directory. Yet the follow...
1

votes
3

answer
4.7k

Views

Android dependency com.google.firebase:firebase-core different version for the compile (12.0.1) and runtime (11.4.2)

this is my Project Gradle dependencies classpath 'com.android.tools.build:gradle:3.1.0' classpath 'com.google.gms:google-services:3.0.0' classpath 'io.realm:realm-gradle-plugin:4.2.0' classpath 'com.google.firebase:firebase-plugins:1.1.1' this is my App Gradle dependencies implementation 'com.googl...
Andrews
1

votes
1

answer
975

Views

Flutter: Firebase Pushnotification On Data Change

After getting the comment, i have deployed this folowing code to my firebase project and it was successfully deploed!.But there is no notifications been send to me. Please check my Firebase Realtime database Screenshot here for better understanding. [ITS SOLVED NOW:IT WILL SEND NOTIFICATIONS TO ONL...
Rajesh Jr.
1

votes
1

answer
187

Views

Firebase Cloud Storage security rule for deleting

Hi I am using Firebase Cloud Storage to develop web application. I would like to set different security rules for setting file from deleting file. It seems that write includes both of them according to the document. Does anyone know how to solve this problem? What I would like to do is this. Anyone...
Tsukasa Nomoto
1

votes
1

answer
152

Views

Permission denied when creating a storage trigger with a named storage bucket

Insufficient permissions to (re)configure a trigger (permission denied for bucket images). Please, give owner permissions to the editor role of the bucket and try again. I am pretty new to firebase. I am trying to implement that if i upload image it resizes it and change the name. The bucket name in...
Anton
1

votes
3

answer
877

Views

Is it possible to use Firebase ML kit api with ionic?

I would like to know if it's possible to use the Firebase ML kit with Ionic. Seems they are only allowing ios and android development but I want to see if someone is aware of a rest api or a library that allows to do this.
Ricardo Parro
1

votes
2

answer
2.9k

Views

When using the onUpdate function in Firebase, how do I retrieve the record that has been updated?

When using the cloud functions on firebase, with the onUpdate trigger, how do I retrieve the record that has been updated (in other words, the record that triggers the function)? I am using JavaScript to interface with the Firebase database.
Ryan
1

votes
1

answer
890

Views

Is it possible to quantize a tflite model?

I have a .pb model, which I want to use as a custom MLKit model. MLKit only supports .tflite models, but even after I use toco to get the TensorFlow Lite model, the file size is too large for Firebase (95 MB and only 40 MB allowed). Is there a way to quantize the graph and then convert to TFLite or...
nerdcortex
1

votes
1

answer
674

Views

Firebase StartAfter in query not working as expected

I am using firebase firestore as my database and i have written firebase functions to retrieve data from the firestore database. What i am trying to achieve is pagination and as per the docs i have implemented the code for my firebase function. Below is the code: exports.getBillList = functions.htt...
Chetan
1

votes
1

answer
47

Views

Best way to put data in multiple places in firebase database

I am not so much familiar with firebase database, I want to store data in target1, if that succeeds then will put some data to target2. Currently I'm doing this: Database.ref('target1').push({ name: name, email: email }) .then(()=>{ Database.ref('target2').push().set({ name: name, email: email }) .t...
Muhammad Ovi
1

votes
1

answer
844

Views

How to order by child value in Firebase

I have data like this: scores: { uid1: { score: 15, displayName: 'Uciska' }, uid2: { score: 3, displayName: 'Bob' }, uid3: { etc... } } I want to rank them by score and keep only the top 100. I did that by following the doc. But it does not work. It always returns the same order even if the score ch...
uciska
1

votes
2

answer
188

Views

Is it able to store Firebase user to our own database?

If I use the user registration and login through the firebase authentication, the user information are stored in the firebase database side. How can I get the user information (such as FirstName, LastName, Gender and etc.) and store in my own database? Is it use the access token to call my API to ch...
ZhengJie Tan
1

votes
1

answer
513

Views

missing script: build - firebase deploy

When I deployed my firebase function project, this error appeared 'missing script:build' and I try to fix it but it fails. Please help me This is error screenshot
Hassan Salah
1

votes
2

answer
798

Views

Disable firebase crashlytics for Android

I am developing an android app and have integrated the firebase and firebase crashlytics SDK. I want to allow the user to disable crash reporting (to ensure GDPR compliance - I assume crash reports are related to GDPR) so need a way for the user to be able to disable it via the apps settings. I fo...
Boardy
1

votes
2

answer
235

Views

Firestore Rules: validate data does not have field

So I currently have two roles for all users: isAdmin and isReader. An Admin is allowed to read and write data and an Reader is allowed to read data. When someone creates an account he has no rights. Not even isReader. Only an Admin can change rules. This is how I planned to do it: Once someone crea...
Jonas
1

votes
1

answer
197

Views

How/Can I manually call a trigger Firebase Function?

In our app we are constantly using callable functions and sometimes the cold start can be a headache, given the fact that we are still developing it and there are no users using them other than us. What we thought to speed up this process is to call every function (they're not much, around 20 at the...
Franco Muñiz
1

votes
1

answer
114

Views

Firestore Import - no error, but no changes

I'm attempting to use the instructions here: https://firebase.google.com/docs/firestore/manage-data/export-import to a) do periodic backups of data from my production instance, and b) copy data between production/staging/dev instances. For what it's worth, each instance is in a separate Firebase pro...
Josh
1

votes
1

answer
103

Views

TypeScript: is not assignable to boolean or PromiseLike

I'm writing a React Native app using TypeScript? I have written a function wrapper for functions from React Native Firebase like this: export const checkPermissions = (): Promise => new Promise((resolve, reject) => { firebase .messaging() .hasPermission() .then(enabled => { if (enabled) { return res...
J. Hesters
1

votes
1

answer
791

Views

How to inner-join in firestore

I want to build a view to show some events inside a listview in my app like this: I have these two tables: Users   Events But I don't know how do a 'inner join' between the tables USERS and EVENTS... I tried this: import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/materi...
Matheus Ribeiro
1

votes
1

answer
134

Views

Can debug logging be added to firestore rules functions?

Given that the firestore rules structure allows for functions, is there some way to add debug logs to those rule-functions ? .. in order to verify that the function you expect, is in fact being called. I see that with the simulator it shows a red X at the line in the rules sturcture, where access is...
Gene Bo
1

votes
1

answer
319

Views

How to get offline uploaded file Download url in Firebase

I want to get the Download Url from uploadTask.addOnProgressListener method of Firebase. How can I get the Download Url using following code? UploadTask uploadTask = storageRef.putBytes(data); uploadTask.addOnProgressListener(new OnProgressListener() { @Override public void onProgress(UploadTask.Tas...
ajay dhadhal
1

votes
1

answer
854

Views

Sending E-Mail through firebase functions

Its there a way to use an API like(sendgrid, mailgun) to send Email through Firebase cloud functions or it is considered as an Outbound connection?
Tido
1

votes
1

answer
652

Views

Using Offline Persistence in Firestore in a Flutter App

I'm developing a app that uses Firebase's Firestore to send data to the web. One of the functions of the app is being able to save data in the device while being offline and send it to Firestore when internet connection is restored. I activated offline persistence but it dosen't work. DEBUG CONSOLE:...
Brenno Fagundes
1

votes
1

answer
133

Views

How to use wildcards in firestore cloud functions?

I'm trying to use a wildcard in a cloud function with firestore like this: exports.function_name= functions.https.onRequest((req, res) => { return admin.firestore().collection('users/messages/{messageCollectionId}') but it does not work. It works if I use an actual id, instead of the wildcard. Any h...
Raul Garcia
1

votes
2

answer
376

Views

Add a Document's Document ID to Its Own Firestore Document - Swift 4

How do I go about adding the document ID of a document I just added to my firestore database, to said document? I want to do this so that when a user retrieves a 'ride' object and chooses to book it, I can know which specific ride they've booked. The problem that i'm facing is that you can't get the...
yambo
1

votes
1

answer
107

Views

Difference between get() and snapshot() in Cloud Firestore

I am reading some data from Firebase's Cloud Firestore but I've seen several ways to do it. The example I saw used the get and onSnapshot function like this: db.collection('cities').doc('SF') .onSnapshot(doc => { console.log(doc.data()); }); or this var docRef = db.collection('cities').doc('SF'); do...
rubotero
1

votes
3

answer
894

Views

Failed to resolve: com.google.firebase:firebase-firestore:16.0.1

I'm switching from realtime database to firestore and I keep getting the same error: Failed to resolve: com.google.firebase:firebase-firestore:16.0.1 I have looked at similar questions on this site but still haven't been able to fix this problem. Here is the code from my app gradle: apply plugin: 'c...
minikate
1

votes
1

answer
109

Views

Calling setState() during build without user interaction

What I did : I have integrated FCM (Firebase Cloud Messaging) in my flutter app. I shared the context and the setState() of each page in static variables with these two lines getting called in all the build functions of my pages : @override Widget build(BuildContext context) { StaticClass.currentCon...
Khalil Bz
1

votes
1

answer
366

Views

ERROR: In project 'app' a resolved Google Play services library dependency depends on another

I getting error like this when I tried to upgrade my plug-ins.I tried lot bu Unable to fix this. Gradle: private static void googleAndFirebase(configuration) { //gcm configuration.implementation 'com.google.android.gms:play-services-gcm:16.0.0' //Firebase libs configuration.implementation 'com.googl...
Rajasekaran M
1

votes
1

answer
51

Views

Add Extra displayName to createUserWithEmailAndPassword Method

I like to add an extra filed to insert user's name into the firebase database and then retrieve it, but i don't know if there's a way to do such thing. here's my markup code Name Email address Password {{errorMessage}} {{successMessage}} Register and here's my typescript code for registering user in...
user3683666
1

votes
2

answer
34

Views

how to get data from child node in firebase in iOS

my database structure is appname: Tasks: childbyautoid1: 'name': 'myname' 'age': '18' childbyautoid2: 'name': 'yourname' 'age': '20' I want to know how to get all data that is name and age of all the child node as I don't know the childbyautoid I am writing Database.database().reference().child('T...
Mohammad Yunus
1

votes
2

answer
51

Views

Cannot invoke 'setValue' with an argument list of type '(Any?, (Error?, DatabaseReference) -> Void)'

I want to send object of structure to firebase. struct commentsData{ var commentsText:String var commentTime:String var commentDay:String var commentMonth:String var commentYear:String } var data = commentsData(commentsText: '', commentTime: '', commentDay: '', commentMonth: '', commentYear: '')...
Captain Newt
1

votes
1

answer
35

Views

Updating chat messages efficiently (continuously) with Firebase's Firestore

I'm working on a React Native app that uses Firebase's Firestore for backend. Right now, every time a new message comes, I'm fetching all messages from the Firestore and updating my state, although it's just one new message that came. function listenCurrentChat(dispatch, chatID) { const address = 'c...
romin21

View additional questions