android gcm push sample in asp

<%
 ' 안드로이드 ASP 푸시 요청
'  브라우저APIkey
 ApplicationAPIKey = "AIzaSyBi0pn1ckaJhRL9kK3mbwsHzk7x0fdE_Z8"
 ' regId(받을사람이 지급받은 registration_ids - 여러명일 경우 배열로 받아처리하면 될 듯 최대 1000)
 RegId = "APA91bFNkzpbgBJnWkDgyGmU0XsF8ZLMAEhVaAtcbf9po8_i1GoA4JNt4HiUc6xScBMEOoJMIHHybZECIns9e2EF4AGalfOgZqwmQIEUG1UpVk08nTapx0iY17vOELD_9wIQTUdRwUsR"
 ' 알림명
 tickerText = "알림테스트"
 ' 알림 제목
 contentTitle = "테스트 제목"
 ' 알림 내용
 message = "헬로~~~ 테스트입니다.~~~"
 postJSONData = "" & _
    "{" & _
    "  ""registration_ids"" : [ """ & RegId & """ ]" & _
    ", ""data"": {" & _
    "                 ""tickerText"" : """ & tickerText & """" & _
    "               , ""contentTitle"" : """ & contentTitle & """" & _
    "               , ""message"" : """ & message & """" & _
    "            }" & _
    "}"
 Set httpObj = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
 httpObj.open "POST" , PushServerURL, False
 httpObj.SetRequestHeader "Content-Type", "application/json"
 httpObj.SetRequestHeader "Authorization", "key=" & ApplicationAPIKey
 httpObj.Send postJSONData
 httpObj.WaitForResponse
 If httpObj.Status = "200" Then
  response.Write("전송성공 : " & httpObj.ResponseText)
 Else
  response.Write("전송실패 : " & httpObj.ResponseText)
 End If
%>

댓글