Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.sendNotification = functions.https.onRequest((request,response) =>{
- var instanceId = "ff1mVdJKDJ4:APA91bEojZyqpQ4EtoegJVSYFifYT_OiZtOUR4Ls9C5S5A8xtK6v85aSWRmzqWPPd1OVoUuJnoPGJgjSMhT6H4cOYYTCrpAJXygd5VCEuWE3jZdv5Qj09zeLpNksqtruhY4f8XqEI9Lv";
- const payload = {
- notification: {
- title:"Prueba desde cloud functions",
- body:"Hola"
- }
- };
- admin.messaging
- admin.messaging().sendToDeviceGroup
- admin.messaging().sendToDevice(instanceId,payload)
- .then(function (response) {
- console.log("Successfully sent message:", response);
- })
- .catch(function (error) {
- console.log("Error sending message:", error);
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement