Button JS to call number in storage?

This forum contains topics that were moved from Get Satisfaction
Viktor
Posts: 0
Joined: Mon Jun 01, 2015 7:48 am

Button JS to call number in storage?

Post 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!

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

Button JS to call number in storage?

Post 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...

Viktor
Posts: 0
Joined: Mon Jun 01, 2015 7:48 am

Button JS to call number in storage?

Post 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

Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Button JS to call number in storage?

Post by Serhii Kulibaba »

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

Viktor
Posts: 0
Joined: Mon Jun 01, 2015 7:48 am

Button JS to call number in storage?

Post 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

Serhii Kulibaba
Posts: 147
Joined: Tue Aug 27, 2013 1:47 pm

Button JS to call number in storage?

Post 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.

Viktor
Posts: 0
Joined: Mon Jun 01, 2015 7:48 am

Button JS to call number in storage?

Post 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.

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

Button JS to call number in storage?

Post by Yurii Orishchuk »

Hi Viktor,

Please try this JS code:

pre

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

/pre

Regards.

Post Reply