Hi, I'm trying to send a notification using Angular.js 1.3
My code:
dataFactory.sendNotification = function()
{
var req = {
method: 'POST',
url: 'https://go.urbanairship.com/api/push',
headers: {
'Authorization': 'Basic <my_master_key>',
'Content-Type' : 'application/json',
'Accept' : 'application/vnd.urbanairship+json; version=3;'
},
data: {
"audience": "all",
"notification": {
"alert": "Test"
},
"device_types": "all"
}
}
$http(req).then(function (response){
// some stuff ....
});
It gives me:
XMLHttpRequest cannot load https://go.urbanairship.com/api/push. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:63342' is therefore not allowed access. The response had HTTP status code 501.
Seems there's no clue to make a push (POST) by a Client (website) via API ?
Comments
1 comment