Push Notification Badges

Hi all, we have implemented push notifications today, and it works like a charm, except BADGES are not showing. The app is setup with “badge” in the config.lua, I have checked in the iphone settings and badges are enabled for the app. We’re using Urban Airship, so I know for sure that they are sending the badge in the payload to Apple correctly. Also, the launchArgs.notification.badge table value shows the correct badge number. How come the app icon doesn’t get a badge then? Carlos? Johnathan? Anyone? [import]uid: 21746 topic_id: 21339 reply_id: 321339[/import]

You know what? I removed newsstand from config.lua, and now badges work. Clearly a Corona bug, but for once it’s a bug I don’t care about, since I have no clue what the newsstand thing is good for anyway… :slight_smile: [import]uid: 21746 topic_id: 21339 reply_id: 84492[/import]

Thanks for the feedback haakon4 … We’ll have to look into the newsstand thing, and advise people not to put that into config.lua for the time being. [import]uid: 52430 topic_id: 21339 reply_id: 84498[/import]

Yup, thanks. I also commented on the push notifications blog post of yours, asking for support for custom payload key/value pairs:

Hi, it seems like you are stripping away custom fields from the payload? You should not, it is an important piece in this kind of communication to be able to do something usefull when the user enters the app via a push notification. It is possible in other mobile frameworks, so please get this implemented asap. Here is an example of a message sent to apple, where everything is showing up in corona except for the custom field. We’re using Urban Airship, and they support custom fields, so it is stripped away in Corona it seems:

{“aps”: {“badge”: 1, “alert”: “Hello”, “sound”: “default”}, “device_tokens”: [“xxx”], “custom_field”: “custom_value”}

http://blog.anscamobile.com/2011/12/push-notifications-for-ios-in-corona-sdk/ [import]uid: 21746 topic_id: 21339 reply_id: 84501[/import]

Nah, just came across another obstacle. How to reset the badge once it’s set? The iphone sdk provides a method for that, did you forget to implement it? :slight_smile: Corona Push is only halfway there without proper badge functionality. We can of course issue a new push notification where badge is set to 0, but that roundtrip is not a proper long term solution, since there are sdk methods to reset the badge on the device. [import]uid: 21746 topic_id: 21339 reply_id: 84512[/import]

“We can of course issue a new push notification where badge is set to 0, but that roundtrip is not a proper long term solution, since there are sdk methods to reset the badge on the device.”

Of course we cant. The only solution is to get the badge reset implemented in corona. So, when will that be fixed, please? [import]uid: 21746 topic_id: 21339 reply_id: 84520[/import]

native.setProperty( “applicationIconBadgeNumber”, 0 )

Jonathan just emailed me this. I can’t find it in the docs, though, but I might not have looked at the right place. [import]uid: 21746 topic_id: 21339 reply_id: 85288[/import]