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

Native Development

Reply
Developer
Posts: 61
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Notification when the application is in the background

I want to pop up a notification when the application is not interacting with the user, or is in the background.

and as a normal Notification does, appear under Notifications of the device.

Is this possible?

Developer
Posts: 16,643
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Notification when the application is in the background

you can use the processStateChanged or thumbailed signal to be notified on status changes.
see https://developer.blackberry.com/native/reference/cascades/bb__application.html?f=appl#function-thum...

with "normal notifications" do you mean in the hub?
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 61
Registered: ‎10-16-2013
My Device: Z10
My Carrier: vodaphone

Re: Notification when the application is in the background

Yes i mean the hub, but my query is, if some data comes to me from the server i need to show the dialog, irrespective if my app is in background or foreground. is this feasible?

Developer
Posts: 16,643
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: Notification when the application is in the background

and why should a notification dialog be dependent on the current app state?
see
https://developer.blackberry.com/native/reference/cascades/bb__platform__notificationdialog.html
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Retired
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30
My Carrier: Bell

Re: Notification when the application is in the background

If you just want to add a notification in the hub (which is what you should be doing unless you have a really strong use case, like an alarm), you can just use the notification class: https://developer.blackberry.com/native/reference/cascades/bb__platform__notification.html

 

If you are aiming for Built For BlackBerry certification (which I recommend) you need to be careful that dialogs are not used to unnecessarily interrupt the user experience: https://developer.blackberry.com/builtforblackberry/documentation/criteria/userexperience.html

 

See best practices here: https://developer.blackberry.com/devzone/design/bb10/dialogs.html

 

 

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker