Page 1 of 2

SMS problem

Posted: Tue May 06, 2014 2:34 am
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.


SMS problem

Posted: Tue May 06, 2014 2:52 am
by Illya Stepanov

Hi Ryan,

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


SMS problem

Posted: Tue May 06, 2014 5:05 am
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!


SMS problem

Posted: Tue May 06, 2014 9:55 pm
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.


SMS problem

Posted: Wed Jun 24, 2015 4:24 pm
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?


SMS problem

Posted: Mon Jun 29, 2015 2:58 pm
by Bobby

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


SMS problem

Posted: Mon Jun 29, 2015 3:33 pm
by Alena Prykhodko

Hello Bobby,

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


SMS problem

Posted: Wed Jul 01, 2015 4:56 am
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.


SMS problem

Posted: Wed Jul 01, 2015 3:10 pm
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)'


SMS problem

Posted: Thu Jul 02, 2015 1:49 am
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.