Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

BB10 - how to add icon to notification bar? - Feature Request!

Hi.

 

Is it possible or planned for the future to access the notification bar. A use-case could be an app running a timer that needs to run until it ends and eg. if the app is "closed"/"in background"/"minimized" (if possible), there should be a possibility to add an icon to the notification bar perhaps with an information dialog styled and added content to it from within the app on a specific event (maybe the blackberry.app.requestBackground event) or action to be called?

 

Something like that possible or planned?

 

Regards


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900

Re: BB10 - how to add icon to notification bar? - Feature Request!

Have a look at HTML5 we notifications (http://www.html5rocks.com/en/tutorials/notifications/quick/) I think it does what you need to do.

 

From one of the BlackBerry10 Jam sessions (http://www.blackberryjamworldtour.com/docs/WEB01.pdf):

"HTML5 API for generating system messages

Proactively notify users about application events"

var icon = "http://testuri.com/icon.png";
var title = "Web Notification";
var msg = "Sent from the Kitchen Sink app.";
var notification = 
webkitNotifications.createNotification(icon, title, msg);
notification.show();

 There is also an example in the kitchensink webworks demo: https://github.com/blackberry/WebWorks-Samples/tree/master/kitchenSink

 

Hope that helps. R

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: BB10 - how to add icon to notification bar? - Feature Request!

THX Rory, I have seen these examples and also visited the Jam session in Berlin, but thought about a little bit more extended use-case. For now it seems we only can bring up a notification to be seen and closed by the user. Thought about a background-task, if an app goes to background and another app is in foreground but the background-app is running some timer (for example) and at the end is showing dialog, it could be helpful to put the dialog into the notification, not only text, also a complete standardAskAsync-dialog with eg. OK and Cancel buttons.

 

Do not know if something like that will be possible with BB10 in the future? Also by running some background task using the <rim:background ...> element this or something similar it will be implemented?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
rorybarnes
Posts: 214
Registered: ‎01-07-2011
My Device: Bold 9900

Re: BB10 - how to add icon to notification bar? - Feature Request!

As far as I know there is nothing available like that, although i am also looking to do something similar for one of my projects.

 

As for background tasks, last I spoke with anyone at RIM about it they were still trying to decide the best way to handle background tasks for BB10, it can be complex to manage for the system and a lot of resources can be tied up if every app has a background task. Maybe Tim can add a better explaination of what, if anything, they are planning.

--
Rory (@roryboy)
Click "Accept as Solution" if post solved your original issue. Give like/thumbs up if you feel post is helpful
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: BB10 - how to add icon to notification bar? - Feature Request!

[ Edited ]

Hi Rory,

I tried to work with the window.webkitNotifications example you provided and it seems to work. I thought and the link to HTML5Rocks assumes we are able to set an icon, but I can not make it happen.

 

I also found something about the Application/Banner notification in the docs @https://developer.blackberry.com/html5/apis/blackberry.app.html#.showBannerIndicator

Is somethings like that on the roadmap for BB10. In the docs the only support is shown for BB OS5+ but not for PlayBook or BB10 at this time. I wanted to bring up some informations to the user, if the app is in background and perhaps another app is inforground, to stay informed but the window.webkitNotifications "only" add messages to the notification bar and bannerIndicator isn't supported (yet??)!!

 

I know I could add some sound but if you are running multiple apps in background it wouldn't be very nice to search for the "annoying" sound or vibration initiator, even if the user wanted to have it ;-)

 

Perhaps the onclose function of the window.webkitNotifications could be helpful to re-invoke the app, if possible ,so it would be a circuit, isn't it?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.
Developer
Developer
LBP
Posts: 607
Registered: ‎04-29-2011
My Device: PlayBook 16GB, BB10 LE Z10 (red)
My Carrier: none

Re: BB10 - how to add icon to notification bar? - Feature Request!


LBP wrote:
...

 

Perhaps the onclose function of the window.webkitNotifications could be helpful to re-invoke the app, if possible ,so it would be a circuit, isn't it?



I tried the onclose function handler and also the ondisplay function handler and it isn't working (yet) for me. I wanted to request a issue, but where to go? Does it refer to the https://github.com/blackberry-webworks/BB10-Webworks-API?


"Like" if you liked the post.
"Accept as Solution" if the post solves your question.
Please use plain text.