Page 1 of 1

Button JS to call number in storage?

Posted: Sun Jun 07, 2015 11:07 am
by Viktor

What do I write in Javascript after the Event of Clicking a button to call a number in local storage?

Thanks in advance!


Button JS to call number in storage?

Posted: Sun Jun 07, 2015 4:13 pm
by Alena Prykhodko

Hello Viktor,

To get localStorage variable value use this code

prelocalStorage.getItem('name');/pre

Where name - localStorage variable name

How to launch dealer you can find here https://devcenter.appery.io/documenta...


Button JS to call number in storage?

Posted: Sun Jun 07, 2015 8:13 pm
by Viktor

tried like this for android:
window.location.href = "tel:" + localStorage.getItem('ad_number');
didn't work.. and how for iOS?
window.open('tel:' + localStorage.getItem('ad_number'), '_system');
?

thanks


Button JS to call number in storage?

Posted: Mon Jun 08, 2015 8:53 am
by Serhii Kulibaba

Hello, what value of the "ad_number" localStorage variable? Please use static string value for testing features instead of full code.


Button JS to call number in storage?

Posted: Mon Jun 08, 2015 10:42 am
by Viktor

Value of the "ad_number" is simply a telephone number. Sorry your second sentence didn't make much sense to me, Im a beginner. Thanks


Button JS to call number in storage?

Posted: Mon Jun 08, 2015 1:26 pm
by Serhii Kulibaba

Does it include plus ("+") symbol? Do you test native application or in browser? Could you check are there any errors in console? This (https://devcenter.appery.io/documenta...) should help.


Button JS to call number in storage?

Posted: Mon Jun 08, 2015 2:53 pm
by Viktor

Yes it does include "+" (if to complicated, it won't). Currently testing on the Appery Tester app on android. Nothing happends when I click the button.

However the iOS one works, I think, since it opens FaceTime on my Macbook when I click on it in the browser. On my mac there is no difference whether there is "+" before the numer or not.


Button JS to call number in storage?

Posted: Tue Jun 09, 2015 12:58 am
by Yurii Orishchuk

Hi Viktor,

Please try this JS code:

pre

window.open('tel: +12345678', '_system');

/pre

Regards.