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

Web and WebWorks Development

Reply
Contributor
kardin
Posts: 34
Registered: ‎11-01-2010
My Device: Torch 9800

Invoke SMS app instead of Email Message ? Can I ?

Hi!

 

It seems that the documentation only show how to invoke the Email Message. What I want is to open the SMS app with pre-fill some text. Is that possible?

 

Thanks

Please use plain text.
Retired
astanley
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Invoke SMS app instead of Email Message ? Can I ?

You can do this only in the BlackBerry 6 browser using the "sms:" scheme, like this:

 

 

<a href="sms:5551234?body=HelloWorld"> Open SMS </a>

 

 

Prior to BlackBerry 6, the "sms:" scheme was not supported.

 

For WebWorks applications, what you are describing is not currently possible, although there is an SMS JavaScript extension that you can use to programmatically send/receive SMS messages.

http://www.blackberry.com/developers/docs/widgetapi/

 

The reason why you cannot launch the SMS application and have it pre-fill the body of a message is because the SMS Application does not allow 3rd party applications to pass arguments to it.

 

Cheers,

Adam

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Please use plain text.
Retired
tneil
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Invoke SMS app instead of Email Message ? Can I ?

I've never tried it but what would happen if you did the following in JavaScript?

 

 

location.href = 'sms:5551234?body=HelloWorld';

 

 

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Please use plain text.
Developer
Silaryn
Posts: 37
Registered: ‎12-24-2010
My Device: Tour

Re: Invoke SMS app instead of Email Message ? Can I ?

You can use window.location = "sms:123456780?body=test" to invoke sms with predefined text. In my experience, the body text should be escaped first and then there are still a few characters that are not escaped (* @ - _ + . /) (http://www.w3schools.com/jsref/jsref_escape.asp). I had to manually replace these additional characters.

 


 

 
Please use plain text.
New Developer
henrik
Posts: 13
Registered: ‎02-17-2012
My Device: 9860, 9900, playbook

Re: Invoke SMS app instead of Email Message ? Can I ?

Is it possible to use window.location = "sms:123456780?body=test" without a predefined phone number?

Please use plain text.
New Developer
henrik
Posts: 13
Registered: ‎02-17-2012
My Device: 9860, 9900, playbook

Re: Invoke SMS app instead of Email Message ? Can I ?

This solved my problem:

 

blackberry.launch.newSMS({ number, text })
Please use plain text.
Contributor
kundan4776
Posts: 10
Registered: ‎03-22-2012
My Device: 9380

Re: Invoke SMS app instead of Email Message ? Can I ?

blackberry.launch.newSMS({ number, text })

 From where u get this API.

 

 did u get any way to launch sms screen from webworks app.

Please use plain text.
Contributor
Galih
Posts: 28
Registered: ‎01-31-2012
My Device: 8520

Re: Invoke SMS app instead of Email Message ? Can I ?

I've been using this API,
blackberry.launch.newSMS({ 'number':'123456', 'text':'my texts body'});
But a text cannot load in device
'text':'my texts body'
some one can help me?
Please use plain text.
Contributor
Galih
Posts: 28
Registered: ‎01-31-2012
My Device: 8520

Re: Invoke SMS app instead of Email Message ? Can I ?


tneil wrote:

I've never tried it but what would happen if you did the following in JavaScript?

 

 

location.href = 'sms:5551234?body=HelloWorld';

 

 

Dear All
I tried this code :
blackberry.launch.newSMS({ 'number':'123456', 'text':'my texts body'});

 

has been work successfully in os 7 and os 6 (please see the screenshoot_success)
screenshoot_success.png
When I apply the code into os 5 and lower, it didnt worked (please see the screenshoot_failed),
screenshoot_failed.png
 I just want the text "GET Lagu10 ON" displayed in message type field. It make me so confusing and disperate. Would you please send this to Blackberry Tester Team?

 

Please use plain text.