IONIC/cordova, make phone call in IOS

后端 未结 2 662
离开以前
离开以前 2021-02-15 13:39

I have found a thread in ionic on this topic: http://forum.ionicframework.com/t/making-phone-call-from-app-href-tel-123/1968/11.

It mentions the whitelist plugin: https:

相关标签:
2条回答
  • 2021-02-15 14:17

    I try it in a tag it worked on android:

    First add cordova-plugin-whitelist

    cordova add plugin cordova-plugin-whitelist
    

    Then add following lines in config.xml

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

    Finally in a tag use line below

    <a href="tel:555 555 5555" target="_blank">
        <i class="fa fa-phone"></i>
    </a>
    
    0 讨论(0)
  • 2021-02-15 14:20

    I have resolved this issue. In my environment(ionic version: 1.4.3 cordova version: 5.0.0), I don't need to add any Plugin or revising the configuration file as ozhanli mentioned. The directive can work as expected. So why I ask this problem? Because I test my program in the simulator, which doesn't support the phone call, message and so on. After deploying my program to a physical device, the directive works.

    So if you want to make a phone call in IONIC(ionic version: 1.4.3 cordova version: 5.0.0) , just add this code to make it work:

    <a href="tel: 110">call</a>
    

    Notice: Test it in physical device, not in simulator.

    0 讨论(0)
提交回复
热议问题