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: 37
Registered: ‎05-30-2009
My Device: Not Specified

Help with setting a custom icon for notifications in the Hub for 10.2

The 10.2 API for Notifications now allow setIconUrl to be specificed when a new notification is created. However I have not been able to get this to work successfully. The code snippet that I have is:

 

QString filePath("file://%1/app/public/myicon.png");

filePath = filePath.arg(QDir::currentPath());

notification->setIconUrl(QUrl(filePath));

 

The docs state that the asset needs to be a public asset and I have done via the bar-descriptor  and have verified that it appears in the public folder when the app is deployed.

 

Any suggestions, examples would be appreciated. 

 

Thanks

 

 

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

Re: Help with setting a custom icon for notifications in the Hub for 10.2

I have my notify.png image in the assets folder and the snippet 

 

notification->setIconUrl(QUrl("app/native/assets/notify.png")) ;

 

works good for me!

Developer
Posts: 37
Registered: ‎05-30-2009
My Device: Not Specified

Re: Help with setting a custom icon for notifications in the Hub for 10.2

Thanks for you reply. Did you need to make that asset a public one? I have tried doing this as well and I am still getting the default "yellow bell" icon.

 

Thanks

Developer
Posts: 97
Registered: ‎11-13-2012
My Device: BB10 Simulator
My Carrier: Globe Telecom

Re: Help with setting a custom icon for notifications in the Hub for 10.2

Man... could you please help us? It really doesn't work. I'm using 10.2 SDK and the icon asset is already set as public... if you could drop as a simple sample project please?