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
New Contributor
Posts: 7
Registered: ‎10-03-2012
My Device: 9810
My Carrier: Bell

Sound when Push Notification Happens

I curently have a WebWorks Application that receives push notifications. I'd like for the application to alert the user with a sound as well. I know that there were some implementations on how to do this using HTML5 audio, such as:

 

var audio = document.createElement('audio');
audio.src="audio/src.mp3";
audio.controls = false;
audio.play();

 

But I want the user to be able to control the sound as well; meaning that if he has "All Alerts Off" selected in the Sounds option, the audio won't play when they receive a push notification. Is this possible to do?

Developer
Posts: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2

Re: Sound when Push Notification Happens

Hi,

 

there is a even better way. Why not integrate the application in the normal Blackberry notification? Then every user can change the notification as every otehr application. You can find the extension on github:

 

https://github.com/blackberry/WebWorks-Community-APIs/tree/master/Smartphone/notification

 

 



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
Highlighted
New Contributor
Posts: 7
Registered: ‎10-03-2012
My Device: 9810
My Carrier: Bell

Re: Sound when Push Notification Happens

Hi,

Thanks for your suggestion. I don't exactly understand this API though. What does each of these functions do?

webworks.notification.register ( [String:App Guid Name] , [String:App Name] )

webworks.notification.fire ( [String:App Guid Name] )

webworks.notification.cancel ( [String:App Guid Name] )

webworks.notification.unregister ( [String:App Guid Name] )

New Contributor
Posts: 5
Registered: ‎09-14-2013
My Device: SQN100-1
My Carrier: Rogers

Re: Sound when Push Notification Happens

Did anyone ever happen to get anywhere with creating multiple notification profiles so that users can configure different notification settings for different events in your app?

 

The sample API that was linked to is for the Smartphone SDK, I'm looking for a way to do this using the WebWorks Blackberry 10 SDK.

 

Any help?

 

Thanks.