This what my body looks like:
body = ‘{“aps”: {“alert”: "’ … message … ‘",“sound”: “default”}}’ – works
Any idea how to reset the badge number to zero? [import]uid: 22152 topic_id: 19522 reply_id: 96738[/import]
This what my body looks like:
body = ‘{“aps”: {“alert”: "’ … message … ‘",“sound”: “default”}}’ – works
Any idea how to reset the badge number to zero? [import]uid: 22152 topic_id: 19522 reply_id: 96738[/import]
Thanks @jonparkins, that’s exactly what I was looking for. Works a treat. [import]uid: 60648 topic_id: 19522 reply_id: 96800[/import]
I have to say I am impressed how well this has worked. Thanks for the sample code.
Would you mind if I turned it into an easily importable module and released that in the code sharing section with both our names on it? [import]uid: 110373 topic_id: 19522 reply_id: 96989[/import]
My turn to ask a question again Anyone had any luck with Rich Push? Code is not my strong point, so I’m not sure if there is a different implementation for that. Currently all I see is that I don’t have any rich users registered. Any ideas? [import]uid: 54327 topic_id: 19522 reply_id: 97237[/import]
I just implemented this into another app and noticed I couldn’t get a token to register on wifi but did on 3G. Anyone else experience that?
Thanks [import]uid: 54327 topic_id: 19522 reply_id: 97420[/import]
I haven’t got 3G but 2 wifi iPads but my Device Tokens aren’t showing in Urban Airship. I have had the ‘allow notifications’ popup on both devices. Don’t know what to do… [import]uid: 61520 topic_id: 19522 reply_id: 97506[/import]
I hadn’t included the ‘mime’ or ‘json’ class! Now everything is fine. [import]uid: 61520 topic_id: 19522 reply_id: 97520[/import]
hmm I have both of those, wonder what the problem is. [import]uid: 54327 topic_id: 19522 reply_id: 97578[/import]
Seems to be working fine now, so now I really have no idea what the problem was
Some more general questions about push. If a user doesn’t go to the push, its in the notification centre, but if you go to the app its not there. I have to access the push through the notification centre. Is that a normal thing for pushes? I don’t use them on anything, its not the end of the world, but would be kind of nice if they were just there waiting in the app when you go to it instead of having to go through the notification centre.
Also if they clear whats in the notification centre, they are lost to the ether, but there is still a badge # on the icon. I haven’t figured out a clean way around that one yet. [import]uid: 54327 topic_id: 19522 reply_id: 97580[/import]
I have a question from our coder, I’ll paste his text below. Basically we’re experiencing a hangup on the code chunk above, and he just wants clarification on a couple things seeing as I just did the old cut and paste
Thanks
The line:
local launchArgs = …
what does that do?
The if block starting with
if launchArgs and launchArgs.notification then
why is that there?
not that I think they are causing a problem. I don’t know what they do, I don’t think they do anything.
My guess (to get it working with Kunundrum) would be that the addEventListener has to be called somewhere else, probably after everything is loaded. Maybe after the call to init(); [import]uid: 54327 topic_id: 19522 reply_id: 106650[/import]
@jonparkins: See this page, it explains just about everything you need to know about launchArgs:
http://blog.anscamobile.com/2011/10/daily-builds-update-626-631/
In short, it has to do with handling local notification events when your app is NOT in the foreground. [import]uid: 52430 topic_id: 19522 reply_id: 106937[/import]
Also, something I noticed about the code you posted:
local launchArgs = …
should be the FIRST line in main.lua, or you can potentially run into problems. It should be above everything else, on LINE 1. [import]uid: 52430 topic_id: 19522 reply_id: 106939[/import]
Thanks I passed all that along to our coder! [import]uid: 54327 topic_id: 19522 reply_id: 106941[/import]
Thank you for the info guys! This thread has been really helpful!
I just have one question–is there anyway we can customize the alert/message such that when the user clicks on the OK button, it redirects him/her to a custom URL? I’m trying to find a way to “push” a custom URL but was unable to. Is this even possible? [import]uid: 44127 topic_id: 19522 reply_id: 110062[/import]
I think that is where you need to be able to do the Rich Push, which I’m still stumbling on getting it to register a user for, the above just handles normal device tokens for the base push. But if you do get a clickable URL sorted I’d love to hear cause that’s the main reason I’ve been trying to get the Rich sorted. [import]uid: 54327 topic_id: 19522 reply_id: 110066[/import]
@jonparkins: Currently figuring it out. Will post here if I’m able to. Thank you! [import]uid: 44127 topic_id: 19522 reply_id: 110108[/import]
For some reason, I’m having issues registering device tokens when I’m using Urban Airship’s production servers. Everything seems to work fine on the test servers though. Am I missing some setting? Appreciate any help guys! [import]uid: 44127 topic_id: 19522 reply_id: 116488[/import]
is that code for client side which subscribe to receive push notification from my app game ??? [import]uid: 160777 topic_id: 19522 reply_id: 117837[/import]
This works really great when integrating with Urban Airship. Thanks very much!! Now what I have to do is get my app to schedule notifications to be delivered by Urban Airship. Anyone had success doing that? You basically use schedule_for in a json structure (https://docs.urbanairship.com/display/DOCS/Server%3A+iOS+Push+API#ServeriOSPushAPI-Statistics) and request for the push to happen. What would the syntax be?
thanks for any help,
best,
Jen [import]uid: 81642 topic_id: 19522 reply_id: 141471[/import]
This works really great when integrating with Urban Airship. Thanks very much!! Now what I have to do is get my app to schedule notifications to be delivered by Urban Airship. Anyone had success doing that? You basically use schedule_for in a json structure (https://docs.urbanairship.com/display/DOCS/Server%3A+iOS+Push+API#ServeriOSPushAPI-Statistics) and request for the push to happen. What would the syntax be?
thanks for any help,
best,
Jen [import]uid: 81642 topic_id: 19522 reply_id: 141471[/import]