0

I´m trying to use Firebase Cloud Message to send notifications through Firebase Cloud Functions. So i´ve deployed a function on Cloud Functions which calls the function admin.sendMessageToTopic(), but I´m getting the warning:

"Billing account not configured. External network is not accessible and quotas are severely limited. Configure billing account to remove these restrictions"

after this, the function proceeds with no error, but the Cloud Message doesn´t send the Message.

Here is the code which i´m getting this error:

exports.sendMessageToTopic = functions.https.onRequest((req, res) => {
    const topic = req.query.topic
    const title = req.query.title
    const body = req.query.body
    const message = {
        data: {
          title: title,
          body: body
        }
      }
    admin.messaging().sendToTopic(topic , message)
        .then(result => {
            console.log("sendMessageToTopic ok:", result)
            res.send("sendMessageToTopic ok")
        })
        .catch(error => {
            console.log("sendMessageToTopic ERROR:", error)
            res.send("sendMessageToTopic ERROR: " + error)
        })
})

If you guys know what should be the problem, please share the solution with us. Thank you guys.

  • Its just warning if you are not doing any outbound calls, you can find more info https://stackoverflow.com/questions/42784135/cloud-functions-for-firebase-billing-account-not-configured apart from that you are facing any other problem you can specify in your question. – Rohit Maurya Jun 03 '18 at 16:43
  • Possible duplicate of [Cloud Functions for Firebase - Billing account not configured](https://stackoverflow.com/questions/42784135/cloud-functions-for-firebase-billing-account-not-configured) – Rohit Maurya Jun 03 '18 at 16:45
  • The warning message can be ignored. Please edit your question to show your code. – Doug Stevenson Jun 03 '18 at 17:00
  • I´ve edited to post my code. – joao paulo lousada Jun 04 '18 at 14:09
  • How are you invoking this function? Have you tried logging all the values in the function to make sure they contain what you expect? – Doug Stevenson Jun 04 '18 at 15:15
  • Billing is NOT required to send FCM messages. If you are not receiving the message I would confirm that the receiving device is actually subscribed to the topic and that the client side code for receiving the messages is correct. – Arthur Thompson Jun 04 '18 at 15:36

0 Answers0