I have a problem understanding how to trigger item.badge in a dashboard view where item is ex: 3!
If the app receives a push notification, how can specify the item to assign it a badge number??
I couldn't really specify which an item index to have the badge on!
Any help is greatly appreciated!
You can see how dashboard item badges are set both at initialization and later in an event listener at http://github.com/appcelerator/KitchenSink/blob/master/KitchenSink/Resources/examples/dashboard.js
The badge you can set with push notifications is the app badge, not an item in a dashboard. If you want to set a badge on an item in a dashboard you can see how it's done in KitchenSink.
Jonathan Harlap, thank you for taking the time to answer my question!
However, if you have tried the facebook app, you can see the item badge if you receive a private message or something similar!
There should be an identifier for the item badge in the dashboard view!
Thank you again!
Please help me out :)
Jonathan Harlap, thank you again! you're awesome! :)
Okay, here is the case in a pseudo code:
If a push notification is successfully received then assign a badge of +1 to the item at index 3 //where item.index(3) is the item of the app news for example end if
where the dashboard will be looking something like
[ ] [ ] [ ] [x] [ ] [ ] [ ] [ ] [ ]
where [x] is the app news item which I want to assign it a badge if a push notification is successfully received.
Thanks again! :)
The answer is (by the help of Jonathan Harlap, many thanks go to him).
var Data = ["item1", "item2", "item3", ... , "itemN"]; /* rest of code goes here ... ... ... and then if a successful push notification is received, just do the following for assigning a badge for the "item3", for example! */ Data.badge = +1;
Thank you Jonathan Harlap :)