Buyin Brian
Buyin Brian

Reputation: 2991

Send PUSH via Urban Airship iOS

I'm trying to send a PUSH via Urban Airship using code in my app.

I can't seem to find any solid documentation on how to do this. I've tried approaches from other posts here on StackOverflow, this one being the most promising: how to send push from iphone via urban airship?

However, following the approach in that post I am getting a 401 error (401 Unauthorized – The authorization credentials are incorrect)

For the auth, I am using the App Key and App Secret. I read on a c# board, that using the App Master Secret as the password will work as expected.

When I tried that approach, I received a 400 error: 400 Bad Request – The request body was invalid, either due to malformed JSON or a data validation error. See the response body for more detail.

Upvotes: 0

Views: 255

Answers (1)

ralepinski
ralepinski

Reputation: 1766

The link uses the old push api. Check out docs on the Push API v3.

However we don't recommend storing or using the master secret directly in the app for security reasons. Instead you should have your app authenticate with a server, then have the server send the push for the device.

Upvotes: 1

Related Questions