urbanairship / ios-phonegap-plugin

This repo is deprecated. Please see: https://github.com/urbanairship/phonegap-ua-push
https://github.com/urbanairship/phonegap-ua-push
68 stars 11 forks source link

is it working with phonegap 1.2.0? #4

Open Sly777 opened 12 years ago

Sly777 commented 12 years ago

Hi all,

I tried it with phonegap 1.2.0 but its not working. Is it only my problem or problem for everyone? I did your integration list what you wrote. Its not giving any error.

Thanks

iamcam commented 12 years ago

I'm curious as well. I didn't have much time to spend debugging it, but I didn't have success right out of the box.

nfitzpatrick commented 12 years ago

I just implemented it with PhoneGap 1.2.0, it is working fine - I registered the device ID with Urban Airship and I was able to receive notifications.

Can anyone provide an example of how to include a JSON payload to specify an alias, tag, badge value, or quiet time setting for this device token when registering? (RE: http://urbanairship.com/docs/push.html#registration)

iamcam commented 12 years ago

@nfitzpatrick It's been a while since I used this plugin, but I think the push composer can help you create the payload, then on the PG side, there are some JS func that help you consume it.

nfitzpatrick commented 12 years ago

@iamcam Thanks for the reply. I figured it out.

ghost commented 11 years ago

@nfitzpatrick Realize you posted this 7 months ago, but wondering if you could shed some light on the solution for me. How did you send the payload? Thanks so much!!

ghost commented 11 years ago

Got the payload working... if anyone else stumbles onto this here is what I did:

add these into the function registerUAPush()


var JSON_payload = {};
JSON_payload.alias = "1";   //add tags etc the same way

request.setRequestHeader("Content-Type", "application/json;");
request.send(JSON.stringify(JSON_payload));