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
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry
Accepted Solution

how to invoke text-messaging app to compose sms from cpp

hi,

 

     i'm trying to invoke the text-message app to send a predefined msg to a predefined contact number.the problem is how to set the data.in the documentation they mention about pps-encoding. i don't have any idea about pps-encoding and to set the data.

 

      so,please help me to solve this issue.

 

thanking you.

BlackBerry Development Advisor
Posts: 157
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

Re: how to invoke text-messaging app to compose sms from cpp

Can you point me to the documentation you're referring to?

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry

Re: how to invoke text-messaging app to compose sms from cpp

BlackBerry Development Advisor
Posts: 157
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

Re: how to invoke text-messaging app to compose sms from cpp

I'll be honest I've not had a lot of success with this route. The documentation looks like it could do with a bit of a review. The closest I could get using just QML was this:

 

import bb.cascades 1.0

Page {
    Container {
        Label {
            text: qsTr("Hello World") + Retranslate.onLocaleOrLanguageChanged
            textStyle.base: SystemDefaults.TextStyles.BigText
        }
    }
    actions: [
        InvokeActionItem {
            id: shareMe
            ActionBar.placement: ActionBarPlacement.OnBar
            query {
                mimeType: "application/text_messaging"
                invokeTargetId: "sys.pim.text_messaging"
                invokeActionId: "bb.action.SENDTEXT"
                uri: "tel:07768999999"
                onQueryChanged: {
shareMe.query.updateQuery() } } handler: InvokeHandler { id: shareHandler onInvoking: { //shareMe.data = "body::Hello!\n"; // trying to set the body text shareHandler.confirm(); } } } ] }

 It launches the composer and pre-populates the mobile number field but I can't coerce the body text to be pre-populated via this route.

 

PPS refers to the QNX publish subscribe servide which uses a particular data format to represent objects it can manipulate. There are some APIs that allow you to encode and parse into and from the PPS data fomat such as here https://developer.blackberry.com/native/reference/cascades/bb__ppsobject.html .

 

If I was looking to add SMS capabilities into an application I'd look at the APIs that are described in this excellent KB article by my colleague Martin http://supportforums.blackberry.com/t5/tkb/articleprintpage/tkb-id/Cascades@tkb/article-id/64 -- it's accompanied by a fully working application with source code in GitHub: https://github.com/blackberry/Cascades-Community-Samples/tree/master/SmsMessageService .

 

These APIs are lower level but do give you much greater control of sending SMS messages including receiving sent receipts etc.

 

I know it's not quite the answer to the question you asked but I hope it's of some use to you.

 

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim
Contributor
Posts: 48
Registered: ‎08-07-2013
My Device: z10
My Carrier: blackberry

Re: how to invoke text-messaging app to compose sms from cpp

thanks for the reply.

 

     i found another way.

request.setUri("sms:"1234567890"?body=Hai how r u");

 

this done my job

 

it sets the number to 1234567890

 

and msg body to "hai how r u"

BlackBerry Development Advisor
Posts: 157
Registered: ‎09-06-2010
My Device: Classic
My Carrier: Vodafone UK

Re: how to invoke text-messaging app to compose sms from cpp

Excellent! Would you flag this one as solved?

---------------------------------------
Please refrain from posting new questions in solved threads.
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Found a bug? Report it here
Follow me on Twitter @jcmrim