FCM (Firebase Cloud Messaging) Push Notification with Asp.Net

前端 未结 7 1002
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-28 22:01

I have already push the GCM message to google server using asp .net in following method,

GCM Push Notification with Asp.Net

<
7条回答
  •  一整个雨季
    2020-11-28 22:41

    Here is my VbScript sample for who prefers vb:

    //Create Json body
    posturl="https://fcm.googleapis.com/fcm/send"
    body=body & "{ ""notification"": {"
    body=body & """title"": ""Your Title"","
    body=body & """text"": ""Your Text"","
    body=body & "},"
    body=body & """to"" : ""target Token""}"
    
    //Set Headers :Content Type and server key
    set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
    xmlhttp.Open "POST",posturl,false
    xmlhttp.setRequestHeader "Content-Type", "application/json"
    xmlhttp.setRequestHeader "Authorization", "Your Server key"
    
    xmlhttp.send body
    result= xmlhttp.responseText
    //response.write result to check Firebase response
    Set xmlhttp = nothing
    

提交回复
热议问题