urbanairship / ruby-library

A Ruby wrapper for the Urban Airship API.
Other
200 stars 118 forks source link

Push doesn't work with version 3 option #76

Closed mmalek-sa closed 9 years ago

mmalek-sa commented 9 years ago

According to your Github readme I just added option v3 to push:

Urbanairship.push notification.merge(version: 3)

but push doesn't work and I can see this error in console:

11:02:36 web.1  | Urbanairship (1587ms): [Post /api/push/, {"device_tokens":["4396d95d024c5b30db02df5f945066defde127c48d12282bd73f80527c940fb7"],"aps":{"alert":" dashboard wishes to authorize","badge":4,"sound":"937.mp3","extra":{"otp":"0a20102dec523ca25d0137fbe7e8053c","created_at":"2015-05-20T06:32:32.897Z"}}}], [400, {"ok":false,"error":"Could not parse request body.","error_code":40000,"details":{"error":"The key 'device_tokens' is not allowed in this context","path":"device_tokens[0]","location":{"line":1,"column":19}},"operation_id":"00cd1550-feba-11e4-9133-001b21aceac8"}]

removing version: 3 solves the problem but I guess it works with version 2 then.

pdxmele commented 9 years ago

Hi! UA just recently took over ownership of this repo and we're currently working on a full rewrite for v3 (but it has not been shipped yet). I'll add a note to the top of the readme to hopefully help clear this up.

mmalek-sa commented 9 years ago

I received an email from Urban Airship:

Have you made the switch to API v3? We hate to bug you, but our servers indicate you are still using API v1/v2. As a valued Urban Airship customer, we want to notify you that we are sunsetting API v1/v2 as we continue to innovate and improve our service. This migration is server-side only, requiring no update to the mobile client code. As of July 31, 2015, API v1/v2 will be discontinued and you will no longer be able to send push messages through these versions. We're asking customers to upgrade at their earliest convenience so you can take advantage of the latest features and have an easy implementation.

So We should switch to API V3 before July 31, but I have no idea how, if you guys don't release the new version by then.

uconnjosh commented 9 years ago

Any updates on this? I am having the exact same issue.

pdxmele commented 9 years ago

We're actually planning on releasing the bare-bones new version first thing tomorrow. Hang in there!

uconnjosh commented 9 years ago

thank you so much!!!

bswinnerton commented 9 years ago

@pdxmele :clap: :clap: :clap: :clap:!

pdxmele commented 9 years ago

New release is out! Please let us know if you have any problems by emailing support@urbanairship.com. This version only supports pushy things so far, not device info, tagging, reports, etc., but feel free to submit requests for other features either to support or in the issues here.