Using the firebase api in postman I can send a notification with an image
I would like to do the same thing using playfab's cloudScript
Using the firebase api in postman I can send a notification with an image
I would like to do the same thing using playfab's cloudScript
CloudScript classic can send HTTP requests, you can try code like below to send the notification.
handlers.FirebasePush = function (args, context) { var headers = { "Authorization": "Your Authorization" }; var body = { "message":{ "token": "Your token", "android":{ "notification" : { "body" : "This is a Firebase Cloud Messaging Topic Message!", "title" : "FCM Message", "image": "your image" } } } } var url = "https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send"; var content = JSON.stringify(body); var httpMethod = "post"; var contentType = "application/json"; var response = http.request(url, httpMethod, content, contentType, headers); return { responseContent: response }; };
2 People are following this question.