Rafael Marques
Posts: 0
Joined: Thu Aug 14, 2014 12:00 am

How to make a button for phone calls, with numbers coming from the database?

How to make a button for phone calls, with numbers coming from the database?

My biggest problem is I have to do to run the app in android and apple, and the codes for the function are different, as I do?

Can you help me?

Rafael Marques
Posts: 0
Joined: Thu Aug 14, 2014 12:00 am

How to make a button for phone calls, with numbers coming from the database?

as I do in case the application is made for android and apple?

I add the two codes at once?

window.location.href = 'tel:' + localStorage.getItem ('botaotel');

window.open ('tel:' + localStorage.getItem ('botaotel'), '_SYSTEM');

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

How to make a button for phone calls, with numbers coming from the database?

Rafael,

You should use one code to export project for Android and other code for IOS: http://devcenter.appery.io/documentat...

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How to make a button for phone calls, with numbers coming from the database?

Hi,

Im trying to do this but nothings happen.this was installed to the 5 devices, the version is 4.0.1,4.1.x,4.0.4
this is the the code

window.location.href='tel:'+ localStorage.getItem('ContactNum');

and i was expecting that after clicking the button, the app will go to the "PHONE DIAL":
Image

you will see this in : https://blog.appery.io/2014/03/dialin...

when i tap the button/click nothings happen.
the localStorage variable has a value +639266977xxx

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How to make a button for phone calls, with numbers coming from the database?

I used the code:

window.open('tel:'+ localStorage.getItem('ContactNum'));

instead of

window.location.href='tel:'+ localStorage.getItem('ContactNum');

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How to make a button for phone calls, with numbers coming from the database?

Hi Team,
INVALID RECIPIENT always every time i clicked the button
i already triend the following codes:

1.
var cnum = localStorage.getItem("ContactNum");
window.open("sms:"+cnum+"?body"+"You are not logged in.","_system");
2.
var cnum = localStorage.getItem("ContactNum");
window.open("sms:"+cnum+"?body=You are not logged in.");

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How to make a button for phone calls, with numbers coming from the database?

I investigate the problem and i think the problem is everytime i tried to launch the following codes there are spaces outside the number screenshot is in below:
Image

and i already try to trim it by the following code:
code
var cnum = localStorage.getItem("ContactNum");
var strSMS ='sms:'+cnum;
var body = '?body=You are not logged in.';
var str = strSMS+body;
window.open(str.trim());
console.log(str.trim());
/code
but no luck, any advice?

Thank you,

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

How to make a button for phone calls, with numbers coming from the database?

this is the screenshot after clicking the button:

Image

its hows INVALID RECIPIENT.,

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

How to make a button for phone calls, with numbers coming from the database?

Hi She,

I guess you have incorrect value in your "" local storage.

Please try following JS code:

pre

var cnum = "+375292771265";//localStorage.getItem("ContactNum");
var strSMS ='sms:'+cnum;
var body = '?body=You are not logged in.';
var str = strSMS+body;
window.open(str.trim(), "_system");
console.log(str.trim());

/pre

I've checked this code on my android device and it works correctly.

Regards.

Return to “Issues”