Sunday, July 27, 2014

Calling GCM by using ASP classic

function sendToGCM(regIds, metaData)

'http://developer.android.com/google/gcm/http.html

Dim DataToSend

DataToSend = DataToSend & "registration_id=" & regids
DataToSend = DataToSend & "&collapse_key=location"
DataToSend = DataToSend & "&data.location=" & metaData

Dim key
key = "AdisfbsisP5MwE389fjnsidsslpx10fm2siusbi8bwc" 'Generated server key for the application

url = "https://android.googleapis.com/gcm/send"

set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP")
    xmlhttp.open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"
'Public API Server Key
xmlhttp.setRequestHeader "Authorization", "key=" & key
xmlhttp.send DataToSend
    returnString = xmlhttp.responseText
    set xmlhttp = nothing

sendToGCM = returnString

end function

No comments:

Post a Comment

Applying SMA10/20, SMA20/50 as trading signals

This is the comparison for results before and after applying SMA10/20 and SMA20/50 in the stock trader. Background Trading 3 stock ma...