Questions tagged [firebase]

16273 questions
1

votes
1

answer
961

Views

Authentication error while sending notification using FCM gem RAILS

I am using FCM gem in rails fcm = FCM.new(Rails.application.config.api_key) registration_ids= [""] # an array of one or more client registration tokens options = {data: {score: "123"}, collapse_key: "updated_score"} response = fcm.send(registration_ids, options) puts "response: #{response}" I am g...
dips
1

votes
3

answer
1.8k

Views

Firebase unable to access data with “snapshot”

I'm writing a web application that uses Firebase, and reading information from the database structured like the following: "user" : { "-KcNmMmqbSvmVXx2vn4A" : { "email" : "[email protected]", "firstname" : "fire", "membership_tier" : 1, "session_count" : 0, "surname" : "base" } I'm attempting to...
Ed Prince
1

votes
1

answer
791

Views

How to get boolean value from the database and add it to a TextView?

I have boolean values stored from a checkbox in my Firebase database and I'm struggling to pull the values from the database. If the user checked the checkbox it will store that value in the database as true or false. What I'd like to do is to then get that value and put it in a TextView. I've bee...
Joe
0

votes
0

answer
25

Views

android app crashes when trying to retrieve data from firebase storage

I'm trying to retrieve the data from firebase but the application crashes when I open the app. I have tried to add MultiDex library and change the versions of libraries to be all the same but the error seems to be with the database storage. I tried to change the Firebase storage and tried different...
Karem Mohamed
0

votes
0

answer
3

Views

Error Integrating Firestore with Javafx Maven Application (IntelliJ Idea)

Exception occurred "com.google.cloud.firestore.FirestoreException: java.lang.IllegalStateException: Could not find TLS ALPN provider; no working netty-tcnative, Conscrypt, or Jetty NPN/ALPN available" on code, InputStream serviceAccount = new FileInputStream("json file path"); GoogleCredentials cred...
Shaheer Raza
1

votes
1

answer
486

Views

'ENDPOINTS_SERVICE_NAME' is not set on Cloud Endpoints with Firebase auth

When I call my API as: PUT https://[Project-id].appspot.com/_ah/api/person/v2/[id]/thanks?thanks=true The response is a 400 BadRequest. { "error": { "errors": [ { "domain": "global", "reason": "badRequest", "message": "java.lang.IllegalArgumentException: Environment variable 'ENDPOINTS_SERVICE_NAME...
nicofo
1

votes
3

answer
3.9k

Views

Passing checkbox value to show / hide Password via react native

I'm using Firebase auth I will want to add a Check box, it will display the password in the password text box and hide it when it is clicked again How to Passing checkbox value to show / hide Password? This is my Login Page Code: export default class Login extends Component { constructor(props) {...
1

votes
1

answer
377

Views

How to convert firebase data (snake_case) to Java object (camelCase)

I want to map my firebase data object to my pojo. However, my firebase object property name is snake case, such as; "user_name". I want to use camelCase on my pojo, such as; "userName" I found beautiful answers like this one, however, I couldn't find any sample about snake_case to camelCase mappi...
Efe Budak
1

votes
2

answer
845

Views

Get data from parent in Cloud Function?

I want to assign to a const the name value inside parent exports.myFunction = functions.database.ref('/messages/{pushId}/likes') .onWrite(event => { const name = event.parent.data.val().name; // this doesn't work. how do I properly get the name which is located in /messages/{pushId} ? });
0

votes
1

answer
95

Views

GCM to FCM in iOS

I use FirebaseInstanceID framework to fetch the token. Current implementation is as below: InstanceID.instanceID().token(withAuthorizedEntity: , scope: "GCM", options: nil) { (token, error) in } My only requirement is of getting the token from Firebase for authentication purposes only. The above imp...
Dhruv
0

votes
0

answer
9

Views

Add array of images to Firebase storage and realtime database using React JS

I am trying to push an array of local images to Firebase store and my database. The images are being outputted in my database json scheme but nothing is showing up in storage and keep receveing the following errors below. Any thoughts? Error: Database JSON scheme: { "users" : { "XhLxS1KUS8UyHjsuHYr...
user992731
0

votes
0

answer
7

Views

How can I set firebase rule for switch button

in the realtime firebase the child Button's value is 'true' I want new value has to be only 'false' while it is 'true' the opposite, it has to be true how can I code up for firebase rule? guessing to use data.exists() or 'true' or 'false' as string but using data.exists() is further reaching to me.
J.Doe
1

votes
2

answer
284

Views

Remove Firebase listener doesn't work Android

I'm adding an event value listener to a reference and when I want to remove it, but it doesn't work. override fun onStart() { super.onStart() stateListener =dbReference.stateRef.addValueEventListener(object : ValueEventListener { override fun onCancelled(p0: DatabaseError?) { TODO("not implemented")...
Amit Laloush
1

votes
1

answer
1.9k

Views

Firebase push notification not showing on phone despite successful response

I am sending a push token to a specific device via the FCM API using https://fcm.googleapis.com/fcm/send. Currently testing with Postman, but I intend to send them from the server. { "to" : "my_device_token", "notification" : { "notificationTitle" :"test from server", "notificationBody" :"test lorem...
bsoolius
0

votes
0

answer
11

Views

What does exposing my service account credentials expose specifically in Firebase?

I'm making a simple java based game and I want to use Google Firebase to store simple variables for the game in real-time. The only option that Google Cloud supports in Java is to use the Firebase Admin SDK. The one problem with this is that it will leave my service credentials exposed in the clien...
Tpixelminer
0

votes
0

answer
6

Views

How to query Firebase-DB for data with given key-value pair in a branched structure?

I'm working on a contact-app for android with firebase and I want to read values (here: the users' profile) from a user in my database that matches a specified email. I tried to design the query like shown in this answer: https://stackoverflow.com/a/39025129/8739722 but the problem is that I don't k...
C.Schoening
1

votes
0

answer
12

Views

Loading images from Firebase is extremely slow

When i migrated all my image-files from inside the application to Firebase then the performance changed alot. Loading the images from the Firebase takes too long and it is not because of my internet (i have 200/200mb down/up speed). Im also using the Glide library to resize my huge images. This is h...
Delice
1

votes
1

answer
1.2k

Views

How to return an observable from an array of observables

I started to play around with Angular 6 and Firebase. I wanted to use Hacker News API for displaying feeds (things). I wanted to return an observable of an array of Thing class. Firstly I need an array of feed IDs, so I make a call to Firebase to fetch these. Then I wanted to fetch the feeds for eac...
amalgamat
1

votes
2

answer
431

Views

How does one upload the dSYM via fastlane to Firebase Crashlytics

Does anyone know how one uploads the dSYM via fastlane to Firebase Crashlytics There is documentation here https://docs.fastlane.tools/actions/crashlytics/#crashlytics But I am unaware of where to get the apiToken, and this seems to be more Crashlytics without Firebase focussed Thanks
Brenwell
0

votes
0

answer
12

Views

Firebase Authentication sign in error handling

Right so I have this function in my server, which basically is creating a new user. I cant figure out how to catch the errors returned by the request. Here is my code: LoginUser(req, res) { try { firebase.auth().signInWithEmailAndPassword(req.body.userEmail, req.body.userPassword) .then( () => { con...
Zeeshan Mahmood
0

votes
0

answer
12

Views

Firebase Database Exception: Class java.sql.Timestamp does not define a no-argument constructor

I have an app that was writing and reading perfectly to and from Firebase. I just added in a timestamp, which is converted from a string (see code below): try { SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); Date parsedDate = dateFormat.parse(eventDate); Timestamp timestamp1 = new...
minikate
1

votes
2

answer
225

Views

Gradle is failing to build with JCenter (using Unity + Firebase)

So I updated Firebase to the latest version (in my Unity game), as my previous version of Firebase had an error with working on iOS devices. And now I can't build with gradle for android devices. Unity version: 2018.2.0f2 Firebase version: 5.4.3 I get this error: FAILURE: Build failed with an except...
Leif
1

votes
2

answer
59

Views

Firestore User Management Best Practices?

So I'm developing a web app using Firestore and Nuxt, and while I got the authentication working I would like to ensure I am following best practices. Using Firebase Authentication only gives me an identifier (email in this case) and an UID. Then I created a user collection to store additional data...
Chris F.
1

votes
1

answer
36

Views

Best way to monitor Firebase Storage for changes [closed]

I am building an app in Unity using Firebase Realtime Database and Firebase Storage. I need to add functionality in the client app that is triggered when a particular Storage directory is updated. The update could happen from the Firebase console itself, not necessarily from the client app. I know...
NeoShaman
1

votes
1

answer
37

Views

Get firestore collection size

TL;DR Is there an API to get firestore collection size instead of us having to do so manually? So according to their docs, one can calculate the document size by identifying their datatypes. A sample code to illustrate the above is as follows: import datetime def calculate_doc_size(data): if isinsta...
Adarsh
0

votes
0

answer
5

Views

firebase-measurement-connector-impl cannot be resolved when syncing with gradle files

In short, when I implement the latest version of firebase-core (version 16.0.7) in my APP-LEVEL build.gradle file, and when I sync with Gradle files, it fails to download one of the dependencies for firebase-core, called firebase-measurement-connector-impl. It searches for version 17.0.5, and it fai...
OmerFlame
3

votes
0

answer
61

Views

Jest Test - The current environment does not support the specified persistence type

I use jest to run some test on my Create React App with Firebase Web SDK coupled with FirebaseUI Whenever I try to run some tests with --env=jsdom - I run into : The current environment does not support the specified persistence type. seems related to Auth Are there any known related issue/workaroun...
Matthieu Veillon
0

votes
0

answer
3

Views

how to configure firebase to use google functions region

I am creating some Go Google Functions in region europe-west1 and trying to call them from Firebase hosting, I have modified the firebase.json to be something like: { "hosting": { "rewrites": [ { "source": "/test", "function": "test" } ], "public": "public", "ignore": [ "firebase.json", "**/.*", "**...
nbari
2

votes
2

answer
63

Views

Firebase Firestore - Query for posts in a big collection where groupId should match a value in an array

I am having troubles with firebase using the cloudstore .where query. I want to query a big collection of documents (in my case posts) but I only want to query the posts in which the groupId matches any of the groups that the user is in. The reason for this is that I want to query a combined feed fo...
Martin Kjellberg
0

votes
0

answer
9

Views

Inconsistent data in firebase collections when simultaneously updating existing documents and creating new documents

I know I couldn't define the problem in the title really well but please hear me out. Here's what I am trying to do. I have a list of materials. Each material has a field of total quantity. User can create orders. Orders contain material type and the quantity of material purchased in that order. Whe...
imaliazhar
0

votes
0

answer
7

Views

For Firebase Dynamic Linking, what do you enter for Team ID if you are using an IOS wildcard?

Where can I find the Team ID for IOS to enter into Firebase for Dynamic linking?
Time
0

votes
0

answer
8

Views

How to add document ID to the firestore document in Python

I am trying to add the document ID of a new document on firestore into the object itself using python, however it shortens the string when adding and doesn't actually add the same ID. I have printed the ID and it says it should be the same. Though in firestore its different. doc_ref = db.collection(...
Jm3s
0

votes
0

answer
6

Views

How to Solve 'Failed to load resource: the server responded with a status of 403 ()' firebase storage web

I have this code when I click the icon named save it should download the file. save.addEventListener('click',function(){ var url=save.getAttribute('url'); //console.log(url); var xhr = new XMLHttpRequest(); xhr.responseType = 'blob'; xhr.onload = function(event) { var blob = xhr.response; }; xhr.ope...
Taio
0

votes
0

answer
11

Views

fcm web push notification- not opening url (using click_action)

As mentioned in the title, I am unable to redirect to a url upon click on the notification. here's my code. // Index.php Firebase Messaging div { margin-bottom: 15px; } MsgElem = document.getElementById("msg") TokenElem = document.getElementById("token") NotisElem = document.getElementById("notis")...
Willson Marandi
0

votes
0

answer
2

Views

MismatchSenderId error Firebase Cloud Messaging (FCM)

I have been facing this error for days, I have read almost every question on this topic, but I haven't figured out the solution. Please don't mark this as duplicate (I have already looked in the previous Questions). I had a look at these similar questions (But no luck) : Question 1 Question 2 Quest...
0

votes
0

answer
4

Views

Android Firebase addValueEventListener excute later in loop

this is MY HomePage.java code ProfileDetail pd=new ProfileDetail(Email1); Log.d("TAG","profile in HomePage"); Profile p=pd.getAllDetails(); Log.d("TAG","profile after Method in HomePAge"); and This Is my ProfileDetail class: public class ProfileDetail { private String mailId; public ProfileDetail()...
bhaskar
0

votes
1

answer
15

Views

How to save user value without logging in and then add data fields in the current user value in some other activity?

I want to create a game app in android kotlin using firestore.When user first enters app he enters a "name" which I want to save in firestore. When he submits name he is taken to next activity screen which has 2 options host n join. If he clicks host he should enter the gameroomname and click host b...
Sar Geo
2

votes
0

answer
17

Views

Can't send notifications from Parse Server

I am trying to send push notifications from Bitnami Parse Server (3.1.2) hosted on AWS. I have the server key and the sender ID from firebase in server.js. Notifications work from the firebase console but not from parse server (neither from the dashbord nor from REST API). It says it's saved but Pu...
VladD
0

votes
1

answer
49

Views

Using Variables in a Firestore Security Rules “List” operation

I'm attempting to setup security rules that allow access to a collection, based on the value of a document field in a subcollection. This works as expected when retrieving an individual document by id, which is a get operation. However, when querying main_collection (a list operation), this fails w...
cokeman19
0

votes
3

answer
18

Views

React axios.get - Firebase

I uploaded some mp3 files to my Storage in Firebase. I am using axios in order to get the relevant files that are stored in the Storage. Inside "rules" tab I changed the permissions to: allow read, write, request; However, I still get an error when I start up my website: Access to XMLHttpRequest a...
I.zv

View additional questions