firebase-admin

Firebase-Admin, importing it to react application throws Module not found error

孤人 提交于 2019-12-02 02:34:39
问题 I'm developming simple React application which uses firebase admin. I have generated react application by using create react app. Then I have installed firebase-admin by using this npm command: npm install firebase-admin --save In my index.js I have added this import: import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; import * as admin from 'firebase-admin' ReactDOM.render(<App />, document

Firestore: get document back after adding it / updating it without additional network calls

丶灬走出姿态 提交于 2019-12-01 23:35:25
Is it possible to get document back after adding it / updating it without additional network calls with Firestore, similar to MongoDB? I find it stupid to first make a call to add / update a document and then make an additional call to get it. As you have probably seen in the documentation of the Node.js (and Javascript) SDKs, this is not possible, neither with the methods of a DocumentReference nor with the one of a CollectionReference . More precisely, the set() and update() methods of a DocumentReference both return a Promise containing void , while the CollectionReference 's add() method

Cloud Messaging in Cloud Functions: admin.messagin(…).send is not a function

不想你离开。 提交于 2019-12-01 18:20:13
My function is triggered by a database event and uses Firebase Cloud Messaging to send a notification to a topic. My first function works fine, but the second one keeps throwing this error: 2018-02-20T21:16:49.878Z E receiveMessage: TypeError: admin.messaging(...).send is not a function at exports.receiveMessage.functions.database.ref.onCreate (/user_code/index.js:55:27) at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:59:27) at next (native) at /user_code/node_modules/firebase-functions/lib/cloud-functions.js:28:71 at __awaiter (/user_code/node_modules

How to get all of device tokens from Firebase?

穿精又带淫゛_ 提交于 2019-12-01 17:38:13
How to get device tokens (FCM registration tokens) from Firebase? I'm making mobile app using firebase and its server using node.js. I want to send push notification message from server, but I don't know how to get devices token. How to get device tokens from external server? I'm using Firebase admin SDK now. Is the device token only generated when the app is connected fcm server? Should I save token to another database when user first run the app and register FCM server? AL. 1. How to get device tokens from external server? I'm using Firebase admin SDK now. There is currently no API to

Cloud Messaging in Cloud Functions: admin.messagin(…).send is not a function

与世无争的帅哥 提交于 2019-12-01 17:18:30
问题 My function is triggered by a database event and uses Firebase Cloud Messaging to send a notification to a topic. My first function works fine, but the second one keeps throwing this error: 2018-02-20T21:16:49.878Z E receiveMessage: TypeError: admin.messaging(...).send is not a function at exports.receiveMessage.functions.database.ref.onCreate (/user_code/index.js:55:27) at Object.<anonymous> (/user_code/node_modules/firebase-functions/lib/cloud-functions.js:59:27) at next (native) at /user

ImportError: Failed to import the Cloud Firestore library for Python

╄→尐↘猪︶ㄣ 提交于 2019-12-01 16:44:59
Trying to integrate Google firestore API at python server ... File "/home/daffolap-355/repos/subscriptions/appvendor/firebase_admin/firestore.py", line 28, in <module> raise ImportError('Failed to import the Cloud Firestore library for Python. Make sure ' ImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module. I get this error here: from firebase_admin import credentials, auth, firestore I installed the firebase-admin module: pip install --upgrade -t libs firebase-admin And run the app dev_appserver app.yaml Google Cloud

How to get all of device tokens from Firebase?

本小妞迷上赌 提交于 2019-12-01 16:15:54
问题 How to get device tokens (FCM registration tokens) from Firebase? I'm making mobile app using firebase and its server using node.js. I want to send push notification message from server, but I don't know how to get devices token. How to get device tokens from external server? I'm using Firebase admin SDK now. Is the device token only generated when the app is connected fcm server? Should I save token to another database when user first run the app and register FCM server? 回答1: 1. How to get

ImportError: Failed to import the Cloud Firestore library for Python

孤者浪人 提交于 2019-12-01 15:45:38
问题 Trying to integrate Google firestore API at python server ... File "/home/daffolap-355/repos/subscriptions/appvendor/firebase_admin/firestore.py", line 28, in <module> raise ImportError('Failed to import the Cloud Firestore library for Python. Make sure ' ImportError: Failed to import the Cloud Firestore library for Python. Make sure to install the "google-cloud-firestore" module. I get this error here: from firebase_admin import credentials, auth, firestore I installed the firebase-admin

Delete Folder from Firebase Storage using Google Cloud Storage

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 09:25:44
I want to delete the folder "test" and everything that is in it. I am sucessfuly able to delete the folder and all it's contents/subfolders in FirebaseStorage with the terminal using this code: gsutil rm -r gs://bucketname.appspot.com/test/** However when I tried to do it in java, it does not work. Storage storage = StorageOptions.getDefaultInstance().getService(); String bucketName = "bucketname.appspot.com/test"; Bucket bucket = storage.get(bucketName); bucket.delete(Bucket.BucketSourceOption.metagenerationMatch()); It throws this exception: Exception in thread "FirebaseDatabaseEventTarget"

Don't show notification when in foreground

谁说胖子不能爱 提交于 2019-12-01 09:22:28
I'm sending push notification from my node server using the Firebase admin SDK. But on iOS I only want to show the notification when the app is in the background/terminated and not when in the foreground. Currently it will always show the notification. This is my payload: const payload = { data: { data: 'data', more: 'moreData', }, notification: { title: 'Incoming Call', body: 'Someone is calling you', text: 'This is some text', sound: 'default', click_action: 'com.example.INCOMING_CALL', } }; const options = { priority: 'high', time_to_live: 30, collapse_key: 'Video Call', content_available: