Questions tagged [firebase-admin]
The Firebase Admin SDK is a set of client libraries which enable App Developers to write more custom behavior for their apps by providing server technologies access to Firebase APIs. Currently, there are libraries for Node.js, Java, Python and Go.
0
votes
0answers
20 views
Create custom token for admin sdk using seed value from Firestore database?
I am generating a device specific unique ID value and am storing it inside a document within my Firestore database. I would like to be able to use this value as a seed for a custom token that would ...
0
votes
1answer
35 views
Firebase Auth - how to refresh access token without current user object
I am accessing my backend with an access token obtained from firebase auth the following way:
login via email & password
receive the current user object
obtain the token from the user object
...
0
votes
0answers
18 views
Firebase Cloud Functions : Failed to read credentials from file
Due to new Firebase Cloud Functions (version > 1.0). I only need to call
admin.initializeApp();
Without any parameters.
However when I did like that then run firebase deploy --only functions , this ...
0
votes
0answers
17 views
Firebase Admin SDK Auth error “TOO_MANY_ATTEMPTS_TRY_LATER”
I'm using firebase admin sdk in my cloud functions and I'm getting error randomly in some executions when trying to get a user by uid .
let userRecord = await admin.auth().getUser(userId);
The error ...
0
votes
2answers
32 views
unable to connect firebase using python 3.72
if anyone knows how to python 3.7 version connect with firebase.
I 'm using the following code,
from firebase import firebase
firebase = firebase.FirebaseApplication('https://your_storage.firebaseio....
1
vote
1answer
37 views
Cloud Function / Firestore: timestampsInSnapshots not working
I'm using Firebase with Firestore and Cloud Function. The problem is that inside my Cloud Function when i get document from Firestore, the dates fields aren't of type Date nor Timestamp.
I'm using ...
0
votes
0answers
18 views
using firebase-admin in netlify function
I am trying to use firebase-admin npm module in a Netlify cloud function. By default netlify-lambda packages the functions with Webpack, which breaks firebase-admin as it's not compatible with Webpack....
-1
votes
0answers
11 views
Is Firebase Admin SDK Messaging threadsafe?
When I use the Firebase Admin SDK to send FCM messages, can I send messages from several different threads simultaneously using FirebaseMessaging.getInstance().send(message)?
1
vote
0answers
12 views
How does Firebase Admin SDK Messaging deal with canonical_ids?
I'm trying to migrate from a custom server implementation of the Firebase Messaging legacy HTTP API to the Firebase Admin SDK, and it looks great, but I don't see any mention of how to deal with ...
0
votes
1answer
22 views
User name empty when sending notification with firebase
I want to send notification to users when they receive new messages with the below JavaScript code
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin....
0
votes
1answer
24 views
How to sign out the user via admin SDK? (make the auth === null)
When the user ID token is revoked the information should be passed to client for actions like reauthentication or user signOut().
On the client we can call FirebaseAuth.DefaultInstance.SignOut. How ...
0
votes
1answer
16 views
What is the Firebase RefBuilder.onOperation<T> method?
I am wondering what the onOperation method of functions.database.RefBuilder is for as I can not find any information about it in the documentation.
0
votes
2answers
53 views
Unable to import database module from firebase_admin
I'm simply trying to add the Firebase Admin SDK to my Python script, but am unable to import the database module due to a TypeError in one of the library's python scripts.
I installed the library as ...
1
vote
2answers
39 views
Firebase Function HTTP Request as Authenticated User
For my Cloud Function, I would like to be able to access certain parts of Cloud Firestore as a particular user in Firebase Auth. There are security rules in place, which allows users based on their ...
0
votes
1answer
45 views
How to fetch a random document from firestore collection, when I have extra where() criteria with inequalities?
I'm trying to write a nodejs cloud function to fetch a random document from my 'profiles' collection in firestore like this:
randomProfile = await admin.firestore().collection('profiles')
.where('...
0
votes
1answer
22 views
How to update a list of users in Firestore using Firebase admin sdk?
So I'm learning how to use the firebase admin sdk and I've come across a problem that I'm not understanding enough to solve. Basically, I've queried my database and gotten a subset of users that I ...
2
votes
1answer
61 views
Verifying ID tokens with Firebase Authentication
We are starting the development of a web app and were thinking of using Firebase Authentication to handle our sign up flow. However, we are unsure about how the ID token verification works. It seems ...
0
votes
1answer
40 views
On complete listener for ApiFuture<WriteResult> with Firestore Admin
Is there a Firebase Admin equivalent of an OnComplete listener? My aim is to update a 'recently searched' list on a document, followed by a status update on whether the action was completed or not.
...
0
votes
1answer
28 views
Decode Firebase token in Java
I am trying to verify/decode a token on my backend and then retrieve the users UID from the decoded token. The token is generated by the client as a string. The backend successfully retrieves/sets ...
0
votes
0answers
30 views
Python Firebase Admin listener automatically fires every hour
I noticed my Firebase admin event listener was getting triggered every hour, even when there were no changes in my database. I put together a small test program to verify, and am seeing that these ...
0
votes
2answers
30 views
Firebase handle transactions in Nodejs
Firebase has documented how to handle transactions with Java but not with Nodejs(document)
Due to its structure transactions might return null at first run and unlike in Java, Nodejs doesn't have ...
1
vote
1answer
32 views
How to ignore 'firebase-admin appears to have been installed in an unsupported environment.'?
I'm using firebase and I'm building an admin dashboard for my team. The dashboard is used to add content to our platform that all users will be able to see.
At first I implemented it using the ...
0
votes
0answers
40 views
How can I solve this error sending notifications using FCM?
I'm using FCM to send notifications to some devices(Android and iOS), but I've been getting these errors lately. For some reason the code was working at some point but now I'm getting errors again.
...
0
votes
1answer
50 views
Error with admin firebase: “admin.auth(…).generatePasswordResetLink is not a function”
I made a email servies via Node.js(nodemailer) and firebase.
When I craete new new user in application, that new user should get welcome email with Link for reseting password.
Now I need to ...
2
votes
1answer
38 views
ValueError: Failed to commit transaction in 5 attempts
TL;DR Transactions not updating the counters as expected
Scenerio:
I have sub collections called projects and activities.
projects collection is used to store information on any on going projects ...
0
votes
1answer
24 views
firebase admin sdk listener callback not working
i am using firebase java sdk for server backend code . i am using saving Async call and waiting on that too but the single value event listeners which were added on database are not working. I even ...
0
votes
1answer
32 views
Get public download URL from uploaded file in firebase storage with Java rest API
I would like to get the download URL from a file (Blob) upload by firebase-admin sdk for java.
My Code:
FirebaseOptions options = new FirebaseOptions.Builder()
.setCredentials(...
0
votes
0answers
25 views
python- Firestore get() performence issue
├───Users
│ ├───full_name
│ ├───...
│ ├───connected_groups[]
├───Groups
│ ├───name
│ ├───...
│ ├───connected_users[]
Users and Groups are my collections. Users have connected_groups ...
1
vote
1answer
62 views
AttributeError: _nanosecond when updating a datetime in transaction
So I am trying to update a datetime field in cloud firestore via cloud function as follows:
transaction.update(doc_ref, {'dateTimeField1': dateTimeValue})
Google sends datetime objects as string in ...
1
vote
1answer
26 views
Is firebase sevices.json needed for admin SDK on cloud functions
I am trying to write a function that writes to a different database when a user writes to the default database ,
I did my research and i am a little bit confused
I saw this on firebase
var admin = ...
0
votes
1answer
17 views
Firebase database onCreate don't update all records
I'm new to cloud functions and I have a big blocker which I can't understand. I created onCreate handler and it triggers correctly on every new item. If I put multiple items to the database and my ...
1
vote
1answer
30 views
WARNING: The behavior for java.util.Date objects stored in Firestore is going to change
I am getting this warning when instantiating the Firestore client.
fs = FirestoreClient.getFirestore();
The warning comes with the solution, to instancianciate the client in the following way:
...
1
vote
0answers
40 views
How to delete the user from firebase? Getting error while deleting user record from firebase
I'm trying to delete the user from Firebase by uid field. For this I'm trying below code.
Constant.js
import * as admin from "firebase-admin";
admin.initializeApp({
credential: admin.credential....
0
votes
1answer
42 views
How to use Firebase Admin SDK in Flutter?
I'm creating a app where I should be able of managing users access. The admin should have permissions of creating, deleting and editing users accounts.
I'm using firebase for creating users account.
...
0
votes
1answer
49 views
Push Notification from Firestore
I need to send notification when data change in my Cloud Firestore database. I have this fields
I need to get the all users tokens and send the push notification. I have a code, but this only give ...
0
votes
1answer
20 views
Get UID from expired Firebase auth token?
For a valid token, we can call admin.auth().verifyIdToken(...). We have a specific case where the token we receive may have expired, but it is not sensitive data so we'd still like to determine the ...
0
votes
1answer
24 views
Firebase admin sdk dependency on gradle causing boot layer error
I'm trying to build a desktop app using javafx for extracting data from pdf and save the content as json in firebase. Adding the firebase admin sdk dependency on gradle causes build error. But it is ...
0
votes
1answer
47 views
Firebase cloud function triggers FCM but Request is missing required authentication credential
I am trying to use firebase-admin inside a firebase cloud function to send a message via firebase cloud messaging (FCM).
When reading through the documentation it says
To use the Admin FCM API, ...
0
votes
0answers
31 views
Firebase Auth Token for Firebase Admin SDK with a Service Account
I built Firebase API which uses the following to authorize Firebase ID tokens which are created by Firebase when a user signs into the Firebase app.
firebaseAdmin.auth().verifyIdToken(idToken)
I am ...
0
votes
1answer
39 views
Firestore Not Writing User Data to Data Base
I'm attempting to load user data into Firestore during sign-up using FirebaseUI Web and Vue.js. The account is created on Firebase's side. However, the database is not being populated - I'm not ...
0
votes
1answer
39 views
Firebase listen() on AWS Lambda
I am creating a serverless infrastructure with multiple functions. So far I have managed to publish a new function on AWS lambda using the aws-sam-cli.
One of the last functions is my firebase ...
1
vote
1answer
61 views
Deploying to AWS lambda hits size limit and packages (such as numpy) are not compatible
I have a relatively small script where I use the following dependencies:
firebase-admin
pandas
Nevertheless, when you install these dependencies you get over 60 additional dependencies installed as ...
0
votes
1answer
21 views
Why do I get 2 sets of children when i use setAsyncValue?
I'm not sure why 2 children are created/updated when using setValueAsync. Maybe someone can help me understand what I'm doing wrong.
Initially I setup manually under the Employee node some children (...
1
vote
1answer
17 views
How to tell if a Firestore operation succeeded or failed?
I need to be able to tell if a set(), delete(), or update() operation on a document has succeeded before I do a transaction operation to increment or decrement a counter.
I've tried to print what set(...
2
votes
1answer
64 views
Enable default sound on FCM notifications for both android and iOS
After several hours searching the web for answers on how to enable the default sound on Firebase cloud messaging notifications, for both android and iOS, I finally figured it out by myself. I could ...
0
votes
0answers
33 views
Creating new firebase storage bucket with dynamic name
We are trying to create a new storage bucket where its name would be dynamically created. The firebase web interface provides this capability. It appears as the admin sdk (node.js) does not.
This ...
0
votes
1answer
73 views
Firebase Storage-How to delete file from storage with node.js?
I want to delete a folder in firebase storage with node js because this is a firebase function.
For example :
storageRef.child(child1).child(child2).delete();
something like this, but firebase ...
0
votes
1answer
27 views
Conditionals within Firebase Functions
This is for using conditionals with Firebase Functions (node.js). I am a total noob when it comes to Javascript so please bear with me. I am trying to send push notifications with different payload (...
0
votes
1answer
19 views
Is there a way of setting a range when querying data of firestore?
I have a collection of documents, all with random id's and a field called date.
docs = collection_ref.order_by(u'date', direction=firestore.Query.ASCENDING).get()
Imagine I had limited the search to ...
2
votes
0answers
54 views
Firebase Cloud Functions returns error when trying to send a message
I'm using Firebase Cloud Functions to send notifications to users when certain events in Firestore are triggered. The example code below was working some time ago, but now I'm getting an error when I ...