firebase-admin

Firestore Add value to array field

匆匆过客 提交于 2019-12-18 03:37:12
问题 Im trying to use Firebase cloud functions to add the id of a chatroom to the users document in an array field. I cant seem to figure out the way to write to an array field type. here is my cloud function exports.updateMessages = functions.firestore.document('messages/{messageId}/conversation/{msgkey}').onCreate( (event) => { console.log('function started'); const messagePayload = event.data.data(); const userA = messagePayload.userA; const userB = messagePayload.userB; return admin.firestore(

Firebase Storage-How to delete file from storage with node.js?

别说谁变了你拦得住时间么 提交于 2019-12-14 03:08:43
问题 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 documentation doesn't tell anything. One more question: When initialize storage documentation node js requires my admin json, but realtime database doesn't want this wonder why? 回答1: Have a look at the Node.js client API Reference for Google Cloud Storage and in particular at the delete() method for a

How to use Firebase Admin SDK in .NET?

十年热恋 提交于 2019-12-13 15:15:53
问题 I have a windows desktop app written in VB.Net.My server needs to connect with the Firebase to send updates to the app (Firebase Realtime Database). Right now I am able to do this using the "Database secrets" in the service accounts, but since this is deprecated, I would like to use the newer Firebase Admin SDK. I will not be needing the actual authentication of any users since this is using a service account. Is there a way I could use the admin SDK or any 3rd Party library (for .NET) which

Send Firebase Reset Password Email After Account Created On Server/Admin

爷,独闯天下 提交于 2019-12-13 14:27:35
问题 I'm creating a website where businesses can offer my service to their clients/users for free. For a business to add a user (under their business account), the business logs in and inputs one of their clients/users email. I then send the client/user email to firebase functions and programmatically create an account. I would like to send this new user a email saying something like 'Account Created: Reset Password' etc., I could do this using sendPasswordResetEmail on the browser, but this

“No versions available for io.grpc:grpc-core:jar:[1.13.1] within specified range” error when I add firebase-admin maven dependency in Eclipse

前提是你 提交于 2019-12-13 03:56:11
问题 I am trying to add firebase-admin dependency in my pom.xml : <dependency> <groupId>com.google.firebase</groupId> <artifactId>firebase-admin</artifactId> <version>6.6.0</version> </dependency> But when I try to build my project using "clean install" command, I get following error : [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Communication Manager 0.0.1-SNAPSHOT [INFO] ------------------------------------

Firebase Admin SDK with Flask throws error No module named 'firebase_admin'

折月煮酒 提交于 2019-12-13 03:54:12
问题 --- Question closed It was my mistake, my uWSGI startup script switches to a different virtualenv. --- Original question I'm trying to publish push notifications from my Flask app server to Android APP. Server environment (dev): Mac OS Sierra Flask 1.0.2 Python 3.6.5 firebase-admin SDK 2.17.0 (the latest version) When running code as Flask application for initialising the SDK, import statement throws error: import firebase_admin ModuleNotFoundError: No module named 'firebase_admin' However,

Firestore Custom Tokens

不羁岁月 提交于 2019-12-13 03:44:18
问题 I am trying to use a custom auth token with firestore. I am using nodejs to generate the token with the following code. const admin = require('firebase-admin'); const serviceAccount = require('./ServiceAccountKey.json') admin.initializeApp({ credential: admin.credential.cert(serviceAccount) }); var uid = "some-uid"; var claim = { control: true }; admin.auth().createCustomToken(uid, true) .then(function(customToken) { console.log(customToken) }) .catch(function(error) { console.log("Error

Firebase Functions Typescript initializeAdmin() with specific uid

安稳与你 提交于 2019-12-13 03:26:17
问题 I have found reference to this method of initializing firebase functions with a unique UID for the purpose of constraining it with database rules, but I keep getting the error Error: Can't determine Firebase Database URL I realize that I can retrieve the DatabaseURL from environment variables, but before I do that, I want to know if I'm doing something wrong because the examples I have seen have not had to do that for Firebase Functions. import * as functions from "firebase-functions"; import

Firestore: code 16 (Request had invalid authentication credentials)

无人久伴 提交于 2019-12-13 02:32:41
问题 i am trying to access Firestore with admin permissions via private key and admin permissions so i can use it for queries and stuff in the backend. //i import fb-admin const firebaseAdmin = require('firebase-admin') //i initialize as admin with a valid credential firebaseAdmin.initializeApp({ credential: firebaseAdmin.credential.cert('./pathto/myprivatekeyinfo.json') }) //i initialize firestore var dba = firebaseAdmin.firestore() //i test the connection by listing all the available collections

Firebase Functions 1.0.0 migration: Trouble with custom initializeApp() with Google Service Account credential

纵然是瞬间 提交于 2019-12-13 00:36:20
问题 I just updated from the beta (v0.9.1) to v1.0.0, and ran into some problems with initialization. As per the migration guide, functions.config().firebase is now deprecated. Here is my initialization before: const serviceAccount = require('../service-account.json') admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: functions.config().firebase.databaseURL, storageBucket: functions.config().firebase.storageBucket, projectId: functions.config().firebase.projectId