Skip to content Skip to sidebar Skip to footer

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.

Post a Comment for "Firebase Functions - Admin.messaging().sendtotopic Executes But Never Makes It To The `then` Block"