Titta
Titta

Reputation: 53

How to use notification in Firebase functions? Error: could not handle the request

I can't use notification from function request of firebase, what's wrong? Error: could not handle the request

Thanks

image

Upvotes: 1

Views: 239

Answers (1)

Rahul Somasundaram
Rahul Somasundaram

Reputation: 596

const admin = require("firebase-admin");
var message = {
  notification: {
    title: '$GOOG up 1.43% on the day',
    body: '$GOOG gained 11.80 points to close at 835.67, up 1.43% on the day.'
  }
};

admin.messaging().sendToDevice(token,message)

Upvotes: 2

Related Questions