Is it possible to manipulate the app badge with Corona? I'd love to be able to set the badge to indicate things in an app.
Looks like a single line of code:
[UIApplication sharedApplication].applicationIconBadgeNumber = 2;
Keep up the great work!
What I don't get, is they see they had come out with "local notifications", but that they don't work like "push notifications". What would they be used for. They also said that the red badge would be part of it... I'm a bit confused.
J.K.
This feature is available in the daily builds: http://blog.anscamobile.com/2011/10/4-brand-new-apis-now-available/
@Joe Kool: For example, take a farming game...perhaps you plant crops and need to tend to them in two hours. You can set the notification to go off in two hours and the user will be notified if they don't have the app open at that time. (My understanding, at least...anyone feel free to chime in and correct me. hehe)
Wouldn't that be the same thing as push notifications?
Again, just my understanding...but I'd figure push notifications originate from an external source and are pushed to all (or a select group of) devices, whereas local notifications are created in-app for that one device.
Ooooookaaaay... now I understand. Thanks for clearing that up, T.O.L. Is there anyone that can verify what he is saying?
Much appreciated,
J.K.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | -- Options for iOS local options = { alert = "Wake up!", badge = 2, sound = "alarm.caf", custom = { foo = "bar" } } -- schedule using seconds from now local notification = system.scheduleNotification( 60, options ) -- schedule using UTC (Coordinated Universal Time) local utcTime = os.date( "!*t", os.time() + 60 ) local notification = system.scheduleNotification( utcTime, options ) local listener = function( event ) print( event.name ) -- ==> "notification" print( event.custom.foo ) -- ==> "bar" end Runtime:addEventListener( "notification", listener ) |
badge is the red number that shows in app Icon
if helps...
http://blog.anscamobile.com/2011/10/daily-builds-update-626-631/
in this link show how to make this notifications when app is not running
Dhennrich.
Ha, I just spent, like 20 minutes trying to figure out why this isn't working, turns out, I'm not a subscriber!!!! LOL
Much appreciated,
J.K.
I would love to use this feature too.
Did you manage to use it in Corona?