Reputation: 16663
I'm using Urban Airship and testing using their REST API. I have Google Cloud Messaging
connected to the Urban Airship account, and one Android device registered successfully.
I can successfully send test messages from the the interface on the Urban Airship dashboard.
But when I try using the REST API https://go.urbanairship.com/api/push/
with the body
{
"audience" : "all" ,
"device_types" : "all",
"notification" : {
"android": {
"alert" : "This is a broadcast."
}
}
}
I get a 400 Bad Request
response with This app is not configured for iOS push
Any idea why?
UPDATE: Listing the specific device APID in the "audience" section returns the same result
Upvotes: 3
Views: 1096
Reputation: 1545
What you have is correct, however you need to include the following HTTP header:
Accept: "application/vnd.urbanairship+json; version=3;
For beginner Ruby developers, it can be achieved like this:
req = Net::HTTP::Post.new(uri.path)
req["Accept"] = "application/vnd.urbanairship+json; version=3;"
When, e.g., posting a notification to UrbanAirship.
Upvotes: 5