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

Posts: 20
Registered: ‎11-17-2010
My Device: Dev Alpha A
My Carrier: -
Accepted Solution

Messages Sample not showing BBM messages

[ Edited ]


I'm using the Cascades PIM Messages Sample. ( Download , Doc
Should it list BBM messages?
It is showing Email conversations just fine. 
I had expected to find BBM messages under the account: "No Name (Pin to Pin)" but no messages are listed there.
BBM itself is working fine and I can send/receive messages. So I know that there is a chat conversation.
My Device: Dev Alpha A - No SIM inserted
SDK: Latest Native SDK
What I have tried already:
adding various permissions to he original unmodified sample
BlackBerry Development Advisor
Posts: 15,874
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Messages Sample not showing BBM messages

This is expected.  The API does not allow you to capture BBM messages (no other API for this either).  

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
New Contributor
Posts: 5
Registered: ‎12-16-2012
My Device: none
My Carrier: none

Re: Messages Sample not showing BBM messages

Will API to access this be available in the future and when? Is there a special reason why BBM messages are not available?


I'm also noticing a similar behaviour for SMS. Are SMS messages not available as well?

Posts: 45
Registered: ‎07-29-2008
My Device: Z10 Red, 8900, PlayBook
My Carrier: E-Plus

Re: Messages Sample not showing BBM messages

Same problem for me. I tried to read SMS messages, but no success. No SMS Messages, no SMS Folders, no SMS Conversations.

Klaus Nahr
Posts: 45
Registered: ‎07-29-2008
My Device: Z10 Red, 8900, PlayBook
My Carrier: E-Plus

Re: Messages Sample not showing BBM messages



i fixed the samples app to view and filter SMS/MMS too.


At first you have to enable the "Text Messages" Permission in bar-descriptor.xml.


In messages.cpp add:


#include <bb/pim/message/MessageFilter>

and change filterMessages() to:


void Messages::filterMessages()
    if (!m_currentAccount.isValid())

    QList<Message> messages;
    bool isSMS_MMS = m_currentAccount.provider().name() == "sms-mms";

    if (isSMS_MMS  &&  m_filter.isEmpty())
        MessageFilter filter;
        messages = m_messageService->messages(m_currentAccount.id(), filter);
        MessageSearchFilter filter;
        // Use the entered filter string as search value
        filter.addSearchCriteria(SearchFilterCriteria::Any, m_filter);
        messages = m_messageService->searchLocal(m_currentAccount.id(), filter);

    // Clear the old message information from the model

    // Iterate over the list of message IDs
    foreach (const Message &message, messages) {
        // If SMS or MMS show only inbound messages
        if (!isSMS_MMS  ||  message.isInbound())
            // Copy the data into a model entry, for SMS/MMS show Body, otherwise Subject
            QVariantMap entry;
            entry["messageId"] = message.id();
            entry["subject"] = isSMS_MMS ? message.body(MessageBody:Smiley TonguelainText).plainText() : message.subject();
            entry["time"] = message.serverTimestamp().toString();

            // Add the entry to the model


The problem is with searchLocal(). It will not return any SMS/MMS message if the filter is empty. Therefore I am calling messages() if the filter is empty. If you change the SearchFilterCriteria to anything else than Any, the filter does not return any result for SMS/MMS. Seems to be another bug.


Inbound and Outbound SMS messages are in one box, thats why I am checking message.isInbound() before adding a SMS message to the list.


SMS message do not have a subject, thats why I am showing the body in the list.

Klaus Nahr