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: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers
Accepted Solution

Sms listening using Cascades SmsTransport

I'm having some trouble with the SmsTransport api. The listeners for phone and email are simple and work great, but when I try and listen for sms I get this runtime warning:

Warning: Object::connect: No such signal bb::pim::message::SmsTransport::messageReceived(unsigned int, const
bb::pim::message::Message&) in ../src/App.cpp:58

and this is the code that is the problem:

     mSmsTransport->registerPort(0);
     connect(mSmsTransport, SIGNAL(messageReceived(unsigned int, const bb::pim::message::Message&)), SLOT(handleSms(unsigned int, const bb::pim::message::Message&)));

Maybe the method signature has changed from what is listed here?
https://developer.blackberry.com/cascades/reference/bb__pim__message__smstransport.html

Also related to this.. is 0 the correct port to register on to listen for SMS's? It worked this way on Java BB but I'm not sure about BB10.
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Sms listening using Cascades SmsTransport

Looks like a bug, I've logged the missing signal issue here:  

 

bb:Smiley Tongueim::message:Smiley FrustratedmsTransport::messageReceived(unsigned int, const bb:Smiley Tongueim::message::Message&) signal not...

 

I'm looking into the port question.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Sms listening using Cascades SmsTransport

For the second question, when using SmsTransport, you need to specify a port.  But SmsTransport is designed to be used for binary SMS messages sent on a custom port.

 

If you want to capture regular SMS messages, use MessageService.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Sms listening using Cascades SmsTransport

So are you saying that the messageAdded signal from MessageService should be triggered when a new SMS arrives? That would be great but it is not what I found on the Dev Alpha A. Emails triggered the signal but not sms's.

 

Would you expect it to work now or do I have to wait for the Hub part of the OS to be enabled in the Jan 30th OS release?

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Sms listening using Cascades SmsTransport

Yes, incoming SMS messages should trigger messageAdded and conversationAdded when a new message arrives.    messageAdded and conversationUpdated are fired when a reply is received to an existing conversation and messageUpdated is fired when you send a reply.

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Sms listening using Cascades SmsTransport

messageAdded works great for both email and sms. Thanks! However messageUpdated doesn't work. In order to connect the signal properly I have to call this line first and currently this line generates a compile error:

 

qRegisterMetaType<bb:Smiley Tongueim::message::MessageUpdate>();

 

Error: 'qt_metatype_id' is not a member of 'QMetaTypeId<bb:Smiley Tongueim::message::MessageUpdate>'

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Sms listening using Cascades SmsTransport

I wasn't able to reproduce that error.  Which version of NDK are you using?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Sms listening using Cascades SmsTransport

I'm using 10.0.10.261. But it was also there in the previous releases as well. What are you using?

BlackBerry Development Advisor
Posts: 15,753
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: Sms listening using Cascades SmsTransport

I also tried in 10.0.10.261 and the previous 10.0.9 release.  Does the BlackBerry dropdown in the tool bar point to the appropriate SDK version?  If so, can you submit a sample project that reproduces this to Issue Tracker?

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Developer
Posts: 64
Registered: ‎07-15-2008
My Device: Z10
My Carrier: Rogers

Re: Sms listening using Cascades SmsTransport

Patching the SDK at C:\devel\bbndk\target_10_0_9_2318\qnx6\usr\include\bb\pim\message\MessageUpdate.hpp and adding the below line to the bottom of the file fixes the problem. Not sure how it works for you unless you have this line.

 

Q_DECLARE_METATYPE(bb:Smiley Tongueim::message::MessageUpdate)