firebase-admin

How do I add an analytics label to data messages with the java Firebase Admin SDK?

被刻印的时光 ゝ 提交于 2020-01-24 10:27:05
问题 As of July 1, Firebase requires the addition of labels to messages in order for analytics to show about the number of data message sends etc. 'Starting Monday, 1 July 2019, you will be able to filter data by an analytics label. Data messages sent without an analytics label might not be represented in this dashboard after that date.' The problem is that the link to the documentation provided by firebase here, does not help. It only refers to HTTP requests whilst I am using the Firebase Admin

Quota exceeded when updating users with Firebase Admin SDK - how can I request more?

核能气质少年 提交于 2020-01-23 07:04:49
问题 We try to update many users in our multitenant setup, when a whole tenant needs to be enabled/disabled. With this, we sometimes run into QUOTA_EXCEEDED errors, especially for large tenants with many users. I have asked how to do this better here: Disable many users at once As there are currently no bulk operations to update users with the Firebase Admin SDK, how can I request a quota raise? I do not see an enable/disable users in the Firebase Authentication Limits The error message does not

using firebase admin sdk on a web client

对着背影说爱祢 提交于 2020-01-23 03:12:06
问题 I need to use the firebase admin sdk to authenticate myself on the back-office of my project. using the sdk on the server side is working just fine. but with a reactjs component (a chat component) to chat between web client and a mobile app, the sdk is not working displaying the following error: Uncaught TypeError: rtdb.initStandalone is not a function at DatabaseService../node_modules/firebase-admin/lib/database/database.js.DatabaseService.getDatabase Has anyone tried this before or is it

Firebase Java Admin SDK don't work

醉酒当歌 提交于 2020-01-23 02:46:27
问题 I am following the documentation on Firebase website on setting up an Java Admin SDK. So I add the dependency to the build.gradle, and added the following code: import java.io.FileInputStream; import java.io.FileNotFoundException; import java.util.HashMap; import java.util.Map; import com.google.firebase.FirebaseApp; import com.google.firebase.FirebaseOptions; import com.google.firebase.auth.FirebaseCredentials; import com.google.firebase.database.DatabaseReference; import com.google.firebase

java firebase-admin cannot log user in and get token no client

断了今生、忘了曾经 提交于 2020-01-22 02:57:09
问题 I have no front end. I want users to use my API e.g (postman) with a basic auth header (email:password) and then using this header I can get the users data from firebase. however I find no method to authenticate the actual user? <dependency> <groupId>com.google.firebase</groupId> <artifactId>firebase-admin</artifactId> <version>6.11.0</version> </dependency> I have correctly connected to DB using FileInputStream serviceAccount = new FileInputStream("path/to/serviceAccountKey.json");

How can I generate access token to file uploaded to firebase storage?

帅比萌擦擦* 提交于 2020-01-22 00:58:26
问题 I'm able to upload a file to my firebase storage bucket via nodejs using the firebase-admin but when I go to the firebase UI I cannot open the file. I noticed that uploaded files via firebase UI will have an access token automatically generated but no for files uploaded via nodejs. I already tried several things like setting metadata with downloadtokens and making the file public after it is uploaded. None has worked. How can I generate the access token via API call rather than having to go

How to load 2 different Firestore docs in one 'onUpdate' Cloud Function?

强颜欢笑 提交于 2020-01-16 14:03:25
问题 I am trying to make an "onUpdate" function that loads the document that has been updated. Then I want to load another document using the data received by the wildcards. So to summarize I want to access the document that was updated and one more that is in the same collection. I want : /userProfiles/{doc1}/employees/{doc2} AND /userProfiles/{doc1} . I can get them both but when I try to use the data from one, it doesn't read the previous data and gives me a ReferenceError . The end goal is to

Firebase: SIgn in/up via GitHub using the same button

只愿长相守 提交于 2020-01-16 08:59:28
问题 I want to allow users to sign in/up via GitHub using firebase by clicking on the same button. I create a new authentication for every user in the server side. With the little piece of code, I'm able to detect if either the user is new or not: const provider = new firebase.auth.GithubAuthProvider(); firebase.auth().signInWithPopup(provider).then((result) => { if (result.additionalUserInfo.isNewUser) { // The user is new } else { // The user is old } But, when the function signInWithPopup is

Firebase serve --only functions, admin.auth() locally does not work unless I manually set the key.json

时光总嘲笑我的痴心妄想 提交于 2020-01-15 03:15:53
问题 I am trying to run cloud functions locally using firebase serve --only functions . It works if I manually specify the key.json that is downloaded when I create a service account through firebase console here: https://console.firebase.google.com/project/project-id/settings/serviceaccounts/adminsdk. And then doing export GOOGLE_APPLICATION_CREDENTIALS=key.json . Why do I have to do this? Shouldn't firebase or gcloud handle this correctly? I thought credential in functions.config().firebase was

How to authenticate to Firebase using Python?

喜夏-厌秋 提交于 2020-01-11 14:31:12
问题 I am building a Web App with Python and I would like to authenticate users. The pyrebase package seems to be outdated and it generates dependency errors so I cannot use it. I know that there is a function from the firebase-admin API that works like this: from firebase import auth email = example@example.com user = auth.get_user_by_email(email) But what if this user has a password? I would like to check if the both the email and the password are provided correctly. Thanks in advance. 回答1: The