SMS problem

This forum contains topics that were moved from Get Satisfaction
Ryan Tusing
Posts: 0
Joined: Mon May 05, 2014 2:41 pm

SMS problem

Post by Ryan Tusing »

Hi! I am trying to use this http://blog.appery.io/2014/03/dialing... tutorial to incorporate an SMS feature into my app. When I paste this javascrip code window.location.href = “sms:+375292771265?body=Hello from Appery.io!”;
I get error messages and when I try to run it nothing happens.

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

SMS problem

Post by Illya Stepanov »

Hi Ryan,

How do you tasting it? And what error message do you getting?

Ryan Tusing
Posts: 0
Joined: Mon May 05, 2014 2:41 pm

SMS problem

Post by Ryan Tusing »

Thanks for the reply, I kinda fixed it. This is working:
window.location = "sms:6235125659?body=item_name_label";

However it puts the text "item_name_labe" in the message text. I am trying to call the local storage variable "item_name_label" not sure what I am doing wrong.

Thanks in advance!

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

SMS problem

Post by Yurii Orishchuk »

Hi Ryan.

Please try this code:

pre
code

//Where "item_name_label" - label name.
var smsText = Apperyio("item_name_label").text();

//Place phone number here. Or use dynamic value like in line above.
var phone = "6235125659&quot

window.location = "sms:" + phone + "?body=" + smsText;

/code
/pre

Regards.

Bobby
Posts: 0
Joined: Wed Jun 24, 2015 4:24 pm

SMS problem

Post by Bobby »

Whenever I run this code on a button click it puts everything in the recipient box. So if the phone number was 1234567890, then when I click on the button that runs this code it takes me to texts and the recipient is '1234567890?body=hello' with nothing in the body. Do you know what I am doing wrong?

Bobby
Posts: 0
Joined: Wed Jun 24, 2015 4:24 pm

SMS problem

Post by Bobby »

Hello,
Sorry for asking again, just wanted to make sure. Are there any updates on this topic?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

SMS problem

Post by Alena Prykhodko »

Hello Bobby,

We'll reply here as soon as have updates.
Working on it, but need additional time.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

SMS problem

Post by Yurii Orishchuk »

Hi Bobby,

Please try following JS code:

pre

//Where "item_name_label" - label name.
var smsText = Apperyio("item_name_label").text();

//Place phone number here. Or use dynamic value like in line above.
var phone = "6235125659";
var smsStr = "sms:" + phone + "?body=" + smsText;

alert("smsStr = " + smsStr);

window.open(smsStr, "_system");

/pre

Regards.

Bobby
Posts: 0
Joined: Wed Jun 24, 2015 4:24 pm

SMS problem

Post by Bobby »

Hi Yurii,
Thanks for the response.
I tried this code and some variations (with phone and smsText variables coming from local storage as well as how you did it from a label) and the same problem persists. Whatever I try to put in the body gets appended to the recipient with the number + '?body=(whatever I set the smsText variable to)'

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

SMS problem

Post by Yurii Orishchuk »

Hi Bobby,

I tried this code and works correctly for me.

Could you please specify on what device you test it?

Also, did you test it other device?

Thanks.

Post Reply