I'm trying to send a broadcast message using a std. html/javascript to Android devices. I have found a script here on stackoverflow but i can't get it to work. it returns no errors. Then a send a message from urban airship admin i works fine. Is i missing something here??
<script language="JavaScript1.2" type="text/javascript">
var ruleObj = {
"android": {"alert": "test"}
}
;
var objStr = JSON.stringify(ruleObj);
// username : Application Key;
// password : Application Master Secret;
jQuery(document).ready(function(jQuery){
jQuery.ajax({
type: "POST",
contentType:"application/json",
username: "qE.........",
password: "zp........",
url:"https://go.urbanairship.com/api/push/broadcast/",
data: objStr,
success: function(data){
alert(data);
}
});
});
</script>