Add red numerical app icon badges?

8 replies [Last post]
crowdcraft
User offline. Last seen 1 year 36 weeks ago. Offline
Joined: 26 Feb 2010

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!

Replies

office83's picture
office83
User offline. Last seen 16 hours 34 min ago. Offline
Joined: 7 Sep 2011

I would love to use this feature too.

Did you manage to use it in Corona?

Joe Kool
User offline. Last seen 6 weeks 1 day ago. Offline
Joined: 1 Jun 2011

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.

TheOddLinguist
User offline. Last seen 20 hours 51 min ago. Offline
Joined: 19 Jan 2011

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)

Joe Kool
User offline. Last seen 6 weeks 1 day ago. Offline
Joined: 1 Jun 2011

Wouldn't that be the same thing as push notifications?

TheOddLinguist
User offline. Last seen 20 hours 51 min ago. Offline
Joined: 19 Jan 2011

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.

Joe Kool
User offline. Last seen 6 weeks 1 day ago. Offline
Joined: 1 Jun 2011

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.

Dhennrich
User offline. Last seen 3 days 5 hours ago. Offline
Joined: 20 Jan 2011

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.

Joe Kool
User offline. Last seen 6 weeks 1 day ago. Offline
Joined: 1 Jun 2011

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.

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.