Page 1 of 1

SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Sun Mar 29, 2015 7:07 pm
by jmd2004

HI,

I'M TRYING TO CODE A BUTTON THAT WILL OPEN UP AN SMS WINDOW AND DYNAMICALLY POPULATE THE "BODY WITH A VARIABLE"

var my_id = localStorage.getItem("user_id");

window.open(‘sms:+375292771265?body= from Appery.io!’, ‘_system’);

Is this possible? If so, any help would be greatly appreciated! Thanks!


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Sun Mar 29, 2015 8:42 pm
by Egor Kotov6832188

Hello,

Try
var my_id = localStorage.getItem("user_id");
window.open(‘sms:+375292771265?body= TEST MESS BEGIN ’+my_id+' TEST MESS END', ‘_system’);


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Mon Mar 30, 2015 4:19 pm
by jmd2004

HI Egor,

Thanks for your quick reply. I found this info from the apple deveolpers website. So unfortunately, it doesn't appear to be possible on IOS. I will test on android.

The sms scheme is used to launch the Messages app. The format for URLs of this type is “sms:”, where is an optional parameter that specifies the target phone number of the SMS message. This parameter can contain the digits 0 through 9 and the plus (+), hyphen (-), and period (.) characters. The URL string must not include any message text or other information.


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Mon Mar 30, 2015 4:32 pm
by Evgene Karachevtsev

Hello jmd2004,

Thank you for the update.


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Mon Apr 27, 2015 3:07 am
by She

Hi i used the code that egor give. but the screen show below always show before the SMS compose show.:
.png?1430103988]Image

How can i move to SMS composition without showing this browser?


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Mon Apr 27, 2015 3:14 am
by She

i used following code:
code
var x = localStorage.getItem('Cnum');
if((x ==="null")){
Appery("popupAlert").popup('open');
}else if (x ===''){
Appery("popupAlert").popup('open');
}else{
window.open('sms:'+ x,'_status');
}
/code

and the browser showed before the sms composition :(


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Tue Apr 28, 2015 6:42 am
by Serhii Kulibaba

Second parameter of window.open() should be '_system'


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Tue Apr 28, 2015 7:12 am
by She

Hi Sergiy,

Everytime i used the '_system' to the second parameter, there's an error and always show the "INVALID RECIPIENT".


SMS - WITH VARIABLE FROM LOCAL STORAGE

Posted: Wed Apr 29, 2015 11:10 am
by Serhii Kulibaba

Could you specify what device and OS version you use to test?