Hi,
i’m having some trouble with setting the title and body for Firebase notifications
the phone is receiving notifications but it only shows app name … it does not show a title or body for the notifications
here’s the code:
local function onSendNotification(event) local errorMessage = nil if event.isError then errorMessage = "Failed to connect to the server." elseif event.status == 200 then elseif event.status == 400 then errorMessage = event.response elseif event.status == 401 then errorMessage = "Failed to authenticate the sender's Google Play account." elseif (event.status \>= 500) and (event.status \<= 599) then errorMessage = "Server failed to process the request. Please try again later." end end local function sendNotificationTopic() if not serverKey then return end--"message": "Blood Donation Required" local jsonMessage =[[{"to": "/topics/donateblood","data": {"message": "Blood Donation Required"}}]] local url = "https://gcm-http.googleapis.com/gcm/send" local parameters = { headers = { ["Authorization"] = "key=" .. serverKey, ["Content-Type"] = "application/json", }, body = jsonMessage, } network.request(url, "POST", onSendNotification, parameters) end sendNotificationTopic()