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

Java Development

Reply
Regular Contributor
Posts: 60
Registered: ‎02-24-2011
My Device: Not Specified

Blackberry Push notification not showing icon

Hello everyone, I developed a push enabled application wich so far it's working right. However the application's icon is not shown on the notification resume screen.

 

EXAMPLE.png

 

As you can see the icon is shown on the top, however on the list it's not.

The code I'm using to register the message is as follows:

 

ReadableListImpl mylist= new ReadableListImpl();
        ApplicationMessageFolder folder = null;
        ApplicationFolderIntegrationConfig config = new   ApplicationFolderIntegrationConfig(false, true, ApplicationDescriptor.currentApplicationDescriptor());
         if(ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(folderId)==null){
        	 folder = ApplicationMessageFolderRegistry.getInstance().registerFolder(folderId, folderName, new ReadableListImpl(),config );
 
        }else {
             folder = ApplicationMessageFolderRegistry.getInstance().getApplicationFolder(folderId);
        }
        mylist.addMessage(msg);
        folder.fireElementAdded(msg,true);
        System.out.println("nr of messages"+folder.hasNewMessages());
        ApplicationIcon icon = new ApplicationIcon(indicatorIcon);
        
        ApplicationIndicatorRegistry reg = ApplicationIndicatorRegistry.getInstance();
        ApplicationIndicator applicationIndicator=reg.getApplicationIndicator();
        if(applicationIndicator==null){
        	applicationIndicator = reg.register( icon, false, true);
        	applicationIndicator.setIcon(icon);
        	applicationIndicator.setNotificationState(true);
        }
        applicationIndicator.setValue(applicationIndicator.getValue()+1);
        applicationIndicator.setVisible(true);

 What's missing in order to show the icon in both places?? Thanks a lot.

Developer
Posts: 152
Registered: ‎07-28-2011
My Device: Bold 9900
My Carrier: MTN

Re: Blackberry Push notification not showing icon

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

Re: Blackberry Push notification not showing icon

also check the messagelist sample in your samples folder.
i think you are missing this:
applicationMessageFolderRegistry.registerMessageIcon
----------------------------------------------------------
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: 152
Registered: ‎07-28-2011
My Device: Bold 9900
My Carrier: MTN

Re: Blackberry Push notification not showing icon

@simon, I think the message icon that you're refering to is for the Application Message Folder. As far as I know, the ApplicationFolderIntegrationConfig takes your app descripter as one of its parameters and the icon is automatically added to the homescreen/dropdown notifications list.

Highlighted
Regular Contributor
Posts: 60
Registered: ‎02-24-2011
My Device: Not Specified

Re: Blackberry Push notification not showing icon

Hi, thanks for the responses. I was able to fix the icon problem. Basically my app was listening to notifications from within an alternate entry point. Thus, when I used this code 

 

ApplicationDescriptor.currentApplicationDescriptor());

I was getting the alternate point app descriptor... and since it had the don't show icon on home screen setting checked, the problem appeared. The solution was to manually find the correct descriptor by using CodeModuleManager class. 

 

Thanks a lot.