firebase-admin

python firebase realtime listener

北慕城南 提交于 2019-11-29 02:40:20
Hi there I'm new in python. I would like to implement the listener on my Firebase DB. When I change one or more parameters on the DB my Python code have to do something. How can I do it? Thank a lot my db is like simple list of data from 001 to 200: "remote-controller" 001 -> 000 002 -> 020 003 -> 230 my code is: from firebase import firebase firebase = firebase.FirebaseApplication('https://remote-controller.firebaseio.com/', None) result = firebase.get('003', None) print result It looks like this is supported now (october 2018) : although it's not documented in the 'Retrieving Data' guide ,

Allowing write access only to Cloud Functions for Firebase

若如初见. 提交于 2019-11-29 02:34:08
How can we secure database via the rules that only allow Cloud Functions for Firebase to write data to certain locations, previously there was an option to add uid to admin client databaseAuthVariableOverride and use that uid in rules section, but now we initialise via admin.initializeApp(functions.config().firebase); so I’m not to sure about how to add additional params in. EDIT is it a good idea to initiate with certificate for this instead? i.e admin.initializeApp({ credential: admin.credential.cert("/path-to-cert"), databaseURL: "database-url", databaseAuthVariableOverride: { uid: "some-id

Verify Firebase Token at Google App Engine

女生的网名这么多〃 提交于 2019-11-28 14:13:36
I am developing an Application at Google App Engine. I am using Cloud Endpoints for the communication between an Android App at my Backend at Google App Engine. The Android client uses Firebase Authentication and sends with every call the Firebase token the Cloud Endpoints. At Google App Engine I use the following code to verify the Firebase Token. I am using the Firebase Admin SDK 4.0.3 Task<FirebaseToken> authTask = FirebaseAuth.getInstance().verifyIdToken(token); try { Tasks.await(authTask); } catch (ExecutionException | InterruptedException e ) { log.severe(e.getMessage()); } FirebaseToken

firebase function get download url after successfully save image to firebase cloud storage

梦想的初衷 提交于 2019-11-28 13:57:42
I'm having problem getting download url in firebase function after saving image to cloud storage. Below is my firebase http function in typescript to save base64 string to jpeg in firebase cloud storage. when i log result, it always empty. I follow this link to get download url " Get Public URL from file uploaded with firebase-admin ". But it give me following error:" SigningError: Identity and Access Management (IAM) API has not been used in project 81673989436 before or it is disabled. " And couldn't find simple example to follow. My plan is to update my firestore table, once uploaded to

How can I list all users using firebase admin sdk

做~自己de王妃 提交于 2019-11-28 07:57:54
问题 Is there a way to list all the users using the firebase admin sdk? Documentation only shows getting one user either by uid or email. 回答1: Update As @Webp says in their answer, there is now an API to list all users in the Admin SDK. Original answer: There is no public API to retrieve a list of users from the Firebase Admin SDK. The typical way to deal with this scenario is to keep a list of the pertinent user information in the Firebase Database. See this original question for more: How do I

How can I update more than 500 docs in Firestore using Batch?

一曲冷凌霜 提交于 2019-11-28 05:02:49
问题 I'm trying to update a field timestamp with the Firestore admin timestamp in a collection with more than 500 docs. const batch = db.batch(); const serverTimestamp = admin.firestore.FieldValue.serverTimestamp(); db .collection('My Collection') .get() .then((docs) => { serverTimestamp, }, { merge: true, }) .then(() => res.send('All docs updated')) .catch(console.error); This throws an error { Error: 3 INVALID_ARGUMENT: cannot write more than 500 entities in a single call at Object.exports

How many topics an app instance can subscribe in FCM?

陌路散爱 提交于 2019-11-28 02:00:55
问题 As mentioned in FCM documents, unlimited topic can be created for one Firebase application. But as the Firebase Admin SDK document: explains an error: messaging/too-many-topics :- A registration token has been subscribed to the maximum number of topics and cannot be subscribed to any more. I was not able to find this threshold value of maximum number of topics. Can anybody explain, what is the limit? How many topics an app instance can subscribe to in FCM? 回答1: I found the answer by running a

The Cloud Functions emulator requires the module “firebase-admin” to be installed

心已入冬 提交于 2019-11-28 01:52:20
Continuing to try to get firebase serve to work again. I just asked this question (and got a good reply, thanks): npm ERR! peer dep missing: firebase-admin@^7.0.0, required by firebase-functions@2.3.1 When doing npm list firebase-admin I now see the expected output -- firebase-admin@7.3.0 . However firebase serve still does not work. I get this: ! Your requested "node" version "6" doesn't match your global version "10" ... ! The Cloud Functions emulator requires the module "firebase-admin" to be installed. This package is in your package.json, but it's not available. You probably need to run

firebase admin SDK create user and send verification email

折月煮酒 提交于 2019-11-27 22:25:47
How can I send a verification email after I create a user with firebase admin SDK? I am trying to combine createUser function and sendEmailVerification function could somebody indicate a hint or an answer? thanks update: the user creation is being done by an admin user who is already signed in in the app, so the admin user is just creating users on the dashboad. This is completely different from the registeration methods. update 2: I tried to follow bojeil's answer , I am still stuck with the step that user signs in with the custom token. It gets into conflict with my current admin user

python firebase realtime listener

自闭症网瘾萝莉.ら 提交于 2019-11-27 17:01:31
问题 Hi there I'm new in python. I would like to implement the listener on my Firebase DB. When I change one or more parameters on the DB my Python code have to do something. How can I do it? Thank a lot my db is like simple list of data from 001 to 200: "remote-controller" 001 -> 000 002 -> 020 003 -> 230 my code is: from firebase import firebase firebase = firebase.FirebaseApplication('https://remote-controller.firebaseio.com/', None) result = firebase.get('003', None) print result 回答1: It looks