Firebase Functions - Admin.messaging().sendtotopic Executes But Never Makes It To The `then` Block
For some reason the then block of an admin function doesn't seem to be executing - I don't see any of the console.log messages in the firebase console: Here is all of my firebase f
Solution 1:
You need to return a promise from your function that resolves when all the asynchronous work is complete. If you don't do that, Cloud Functions will terminate your function, possibly before the work is complete.
In your case, you should put a return
keyword in front of admin.messaging()...
instead of returning null.
Please read the documentation for more information, and watch my video series on dealing with promises in Cloud Functions.
Baca Juga
- Firebase Cloud Function Error: Registration Token(s) Provided To Sendtodevice() Must Be A Non-empty String Or A Non-empty Array
- How To Fix "function Returned Undefined, Expected Promise Or Value" When Creating A Function For Firebase?
- How To Query The Existing Children Of A Sibling Node And Loop Over Them To Detect If It Exists?
Post a Comment for "Firebase Functions - Admin.messaging().sendtotopic Executes But Never Makes It To The `then` Block"