Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a contact's phone number clickable to call and to send a message in ionic?

I cloned the ionic project from GitHub

While the contact's phone number is not clickable to call and message. So for the index.html file line 39, I converted from

<p ng-if="contact.emails.length > 0">{{contact.emails[0].type}} : {{contact.emails[0].value}}</p>

to

<p ng-if="contact.phones.length > 0">{{contact.phones[0].type}} : <a ng-href='{{contact.phones[0].value}}'>{{contact.phones[0].value}}</a></p>

But it turns out the app will not load any contact's information anymore.

Is there anything I missed or am I totally wrong on sending data?

like image 814
Photunix Avatar asked Feb 10 '23 09:02

Photunix


1 Answers

to make phone call with ionic you need to add this code in confi.xml

<access launch-external="yes" origin="tel:*" />

and in your view you need to add:

<a ng-href=tel:{{user.phoneNumber}} class="button button-positive">Call me</a>
like image 130
sandy Avatar answered Feb 12 '23 00:02

sandy