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

BlackBerry Push Development

Reply
Super Contributor
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido

How to play sound and change badge when app is not running in background nor foreground

Hi,

 

I have just gotten push notifications to work for my app. The payload comes in fine and I can play a sound and change the badge. But this is when the app is running.

 

I have set registerToLaunch() which works fine, but all it does is launch my app in the background. How do I get a sound to play and change the badge?

 

Thanks!

Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to play sound and change badge when app is not running in background nor foreground

Have you tried using the Notification APIs?

Garett
@garettBeuk
--
Goodbye everybody!
Super Contributor
Posts: 398
Registered: ‎01-12-2011
My Device: Q10
My Carrier: Fido

Re: How to play sound and change badge when app is not running in background nor foreground

Is there a method in my code that gets called specifically when an app is launched in the background due to a push notification?

Highlighted
Retired
Posts: 2,559
Registered: ‎10-16-2009
My Device: BlackBerry Z10
My Carrier: Bell

Re: How to play sound and change badge when app is not running in background nor foreground

Have you taken a look at the sample app? It has a pretty comprehensive overview of how pushes are handled:

https://developer.blackberry.com/native/documentation/cascades/device_comm/push/developing_a_push_en...

Garett
@garettBeuk
--
Goodbye everybody!