Sign in to follow this  
Followers 0
tsilva

Exemplo Rest para envio de push notificacion

2 posts in this topic

Aqui um exemplo de rest metodo GET para mandar push.

oRequest is httpRequest
oResponse is httpResponse

oRequest..URL = "https://fcm.googleapis.com/fcm/send"
oRequest..Method = httpPost

oRequest..Header["Authorization"] = "key=AAAACvU7oQQ:chave firebase"

oRequest..Header["Content-Type"] = "application/json"

oRequest..ContentType = "application/json"

// Request content
oRequest..Content = [
{
"to" : "token cell 1",
"to": "token cell 1",
"collapse_key" : "type_a",
"notification" : {
"body" : "New announcement assigned",
"OrganizationId":"2",
"content_available" : true,
"priority" : "high",
"subtitle":"Elementary School",
"Title":"hello"
},
"data" : {
"priority" : "high",
"sound":"app_sound.wav",
"content_available" : true,
"bodyText" : "New Announcement assigned",
"organization" :"Elementary school"
}
}
]

// Runs the request and retrieves the response
oResponse = HTTPSend(oRequest)

2 people like this

Share this post


Link to post
Share on other sites

Boa tarde,

Muito obrigado pelo contribuição, Tom!

Janio


PS: Estamos movendo o tópico para a seção dicas e truques

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0