Text Messages

The following information shows you how to use invocation framework with Text Messages. See Message for information on using the text messaging API.

Composing a text message

Here are the invocation attributes that you use to launch the composer card for the Text Messages app with specific body text and recipients:

Attribute Value
Target ID

sys.pim.text_messaging.smsuri

Action

bb.action.COMPOSE

MIME type

application/text_messaging

Data must be PPS-encoded and contain the following fields:

Field Description
to

This field represents the list of recipients in JSON format.

body

This field represents the text contained in the body of the text message.

send

This field should be set as a Boolean value. If the value is set to true, the message is sent right away. If the value is false, the composer remains on the screen.

The following examples show PPS-encoded data fields:
// Example 1
body::Hello world!
to:json:["2125551212","9785551234"]

// Example 2
body::Hello world!
send:b:true
to:json:["2125551212"]

Here are the invocation attributes that you use to launch the composer card for the Text Messages app with a recipient field set to a specified phone number:

Attribute Value
Target ID

sys.pim.text_messaging.smsuri

MIME type

application/vnd.blackberry.string.phone

Data

Recipient’s phone number

You can perform the same invocation by using the following invocation attributes in your invocation request:

Attribute Value
Target ID

sys.pim.text_messaging.smsuri

Action

bb.action.SENDTEXT

URI

tel:5198887465

Sharing an attachment with a recipient

Here are the invocation attributes you use to share an attachment with a recipient, using the Text Messages app:

Attribute Value
Target ID

sys.pim.text_messaging.sharemedia

Action

bb.action.SHARE

URI

list://

MIME type

filelist/media

You can perform the same invocation by using the following invocation attributes in your invocation request:

Attribute Value
Target ID

sys.pim.text_messaging.smsuri

Action

bb.action.SENDTEXT

URI

tel:5198887465

Data should be sent in JSON format, as shown below:

[
   {
      "uri": "file:///path/to/file"     
   },
   {
      "uri": "file:///path/to/another_file"     
   },
   ...
]

Last modified: 2014-09-29



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus