google-cloud-functions

Cannot delete Google Cloud Storage files using Firebase Functions

╄→尐↘猪︶ㄣ 提交于 2020-01-06 08:14:50
问题 I cannot seem to delete files from my Firebase Storage using Firebase Functions. I have been at it for almost a week now, and the "closest" I have gotten I believe is an error within the error itself, "Cannot parse JSON response at ApiError ". Now, what I want to be doing is that once a Firebase user is deleted, I want to clear my database and storage from the users files and data. const admin = require('firebase-admin'); const {Storage} = require('@google-cloud/storage'); exports

Cannot delete Google Cloud Storage files using Firebase Functions

泪湿孤枕 提交于 2020-01-06 08:14:25
问题 I cannot seem to delete files from my Firebase Storage using Firebase Functions. I have been at it for almost a week now, and the "closest" I have gotten I believe is an error within the error itself, "Cannot parse JSON response at ApiError ". Now, what I want to be doing is that once a Firebase user is deleted, I want to clear my database and storage from the users files and data. const admin = require('firebase-admin'); const {Storage} = require('@google-cloud/storage'); exports

Firestore order of writes

情到浓时终转凉″ 提交于 2020-01-06 08:04:14
问题 we've been using realtime database to save some data from mobile devices (ios, android + now web). I earlier asked if the order, in which other clients see the data, is guaranteed to be the same order in which client wrote those. (here Does Firebase guarantee that data set using updateValues or setValue is available in the backend as one atomic unit? , the title is a bit misleading, but the answer is there) The answer was yes, and now we're migrating to Firestore and I'm wondering if the same

Firestore order of writes

二次信任 提交于 2020-01-06 08:03:17
问题 we've been using realtime database to save some data from mobile devices (ios, android + now web). I earlier asked if the order, in which other clients see the data, is guaranteed to be the same order in which client wrote those. (here Does Firebase guarantee that data set using updateValues or setValue is available in the backend as one atomic unit? , the title is a bit misleading, but the answer is there) The answer was yes, and now we're migrating to Firestore and I'm wondering if the same

Cannot update a Firestore's document after a purchase verification using Firebase functions

帅比萌擦擦* 提交于 2020-01-06 06:55:14
问题 I've been working on a function to verify purchase in server side. Everything works well. Only one issue, when the purchase is valid (the response.status === 200) the console shows (success) but the document hasn't been updated. Here is my code. Did i miss something ? const functions = require('firebase-functions'); const admin = require('firebase-admin'); const {google} = require('googleapis'); const publisher = google.androidpublisher('v2'); const authClient = new google.auth.JWT({ email:

Cloud Function finished with status: 'timeout'"

十年热恋 提交于 2020-01-06 06:44:13
问题 In Firebase console, the last Event message in Functions/Log section is "Function execution took 60006 ms, finished with status: 'timeout'". Is "timeout" the status the function is supposed to finish with? Or did I miss something in the code that would say "that's the end"? 回答1: You should send a response like res.send(200) at the end for it to terminate properly 来源: https://stackoverflow.com/questions/57211842/cloud-function-finished-with-status-timeout

Cloud Function finished with status: 'timeout'"

久未见 提交于 2020-01-06 06:44:08
问题 In Firebase console, the last Event message in Functions/Log section is "Function execution took 60006 ms, finished with status: 'timeout'". Is "timeout" the status the function is supposed to finish with? Or did I miss something in the code that would say "that's the end"? 回答1: You should send a response like res.send(200) at the end for it to terminate properly 来源: https://stackoverflow.com/questions/57211842/cloud-function-finished-with-status-timeout

How to use FCM topics for notification in chat app?

佐手、 提交于 2020-01-06 06:09:35
问题 I am make chat feature with Flutter and Firestore backend. Every message is new document in Firestore collection with UID and text field. Chat is 1:1 and random so no know who user will talk to before enter chat. DocID in chat collection are all auto-id. I have read can use topics to manage send notification. This should be easier than use individual device fcm token. Anyone know how to implement use topic for this random 1:1 chat app? 回答1: You can definitely use a separate topic for each 1:1

Firebase cloud function always timeout in logs

时间秒杀一切 提交于 2020-01-06 05:45:10
问题 I am using code from this link: https://codelabs.developers.google.com/codelabs/firebase-cloud-functions/#9 and always I get timeout in logs for cloud function, here is a code: exports.sendPatrola = functions.database.ref('/test/tmp') .onUpdate((change, context) => { const original = change.after.val(); var payload = { data: { id: String(original.id), x: String(original.x), y: String(original.y), dat: String(original.dat) } }; var options = { priority: 'high', contentAvailable: true,

Firebase cloud function won't return anything from forEach?

馋奶兔 提交于 2020-01-06 05:26:16
问题 When my trigger receives an update, I am trying to loop through another node via the admin sdk to iterate through the results from the snapshot with matching keys from the wildcard {itemId}. For some reason my forEach seems to not do anything and I don't know why. I have been trying to resolve this for quite some time now. I have never had a problem querying my firebase DB but now that I am trying to do so in cloud functions I have not been having any luck at all. I don't know if this is